Bird
Raised Fist0
Excelspreadsheet~15 mins

Why text manipulation cleans data in Excel - Business Case Study

Choose your learning style10 modes available
Scenario Mode
👤 Your Role: You are a data analyst at a retail company.
📋 Request: Your manager wants you to clean customer contact data to prepare it for marketing campaigns.
📊 Data: You have a list of customer names and phone numbers. Some names have extra spaces, inconsistent capitalization, and phone numbers have different formats.
🎯 Deliverable: Produce a cleaned list where names are properly capitalized without extra spaces, and phone numbers are in a consistent format (only digits, no spaces or symbols).
Progress0 / 5 steps
Sample Data
Customer NamePhone Number
alice smith (123) 456-7890
BOB JOHNSON123.456.7891
Charlie Brown123 456 7892
diana prince+1-123-456-7893
edward king1234567894
Fiona O'connor123-456-7895
george harris 123 456-7896
Hannah Lee1234567897
1
Step 1: Remove extra spaces from customer names using the TRIM function.
=TRIM(A2)
Expected Result
"alice smith" (without spaces before or after)
2
Step 2: Capitalize customer names properly using the PROPER function on trimmed names.
=PROPER(TRIM(A2))
Expected Result
"Alice Smith"
3
Step 3: Remove all non-digit characters from phone numbers to keep only numbers.
=TEXTJOIN("", TRUE, IFERROR(MID(B2, ROW(INDIRECT("1:"&LEN(B2))), 1)*1, ""))
Expected Result
"1234567890"
4
Step 4: Apply the formula from step 3 to all phone numbers to standardize their format.
Copy formula down from step 3 for all rows in phone number column.
Expected Result
All phone numbers appear as numbers without spaces or symbols.
5
Step 5: Create a cleaned table with columns: Cleaned Name and Cleaned Phone Number using formulas from steps 2 and 3.
In new columns, use =PROPER(TRIM(A2)) for names and formula from step 3 for phone numbers.
Expected Result
Cleaned names like "Alice Smith" and phone numbers like "1234567890" for all rows.
Final Result
Cleaned Customer Data
---------------------
Name           | Phone Number
---------------|-------------
Alice Smith    | 1234567890
Bob Johnson    | 1234567891
Charlie Brown  | 1234567892
Diana Prince   | 11234567893
Edward King    | 1234567894
Fiona O'Connor | 1234567895
George Harris  | 1234567896
Hannah Lee     | 1234567897
✓Extra spaces in names cause inconsistency and can be removed with TRIM.
✓Proper capitalization makes names look professional and consistent.
✓Phone numbers have many formats; removing non-digit characters standardizes them.
✓Clean data is easier to use for marketing and reduces errors in communication.
Bonus Challenge

Format cleaned phone numbers to the pattern (XXX) XXX-XXXX for better readability.

Show Hint
Use the TEXT function with a custom format or combine LEFT, MID, and RIGHT functions to insert parentheses and dashes.

Practice

(1/5)
1. Why is it important to use text manipulation functions like TRIM when cleaning data in Excel?
easy
A. They change numbers into text format automatically.
B. They remove extra spaces that can cause errors in calculations or lookups.
C. They create new columns with random data.
D. They delete all the data in the sheet.

Solution

  1. Step 1: Understand what extra spaces do in data

    Extra spaces can make Excel treat similar text as different, causing errors in formulas like VLOOKUP or COUNTIF.
  2. Step 2: Role of TRIM function

    TRIM removes all extra spaces except single spaces between words, making data consistent and easier to work with.
  3. Final Answer:

    They remove extra spaces that can cause errors in calculations or lookups. -> Option B
  4. Quick Check:

    TRIM fixes spaces = cleaner data [OK]
Hint: Extra spaces cause errors; TRIM removes them fast [OK]
Common Mistakes:
  • Thinking TRIM changes numbers to text
  • Believing TRIM deletes data
  • Confusing TRIM with functions that add data
2. Which of these formulas correctly removes all spaces from the text in cell A1?
easy
A. =TRIM(A1)
B. =LEFT(A1, LEN(A1)-1)
C. =SUBSTITUTE(A1, " ", "")
D. =CONCAT(A1)

Solution

  1. Step 1: Understand what each function does

    TRIM removes extra spaces but keeps single spaces between words. SUBSTITUTE replaces specified characters. LEFT extracts characters from the left. CONCAT joins text.
  2. Step 2: Identify which removes all spaces

    SUBSTITUTE(A1, " ", "") replaces all spaces with nothing, effectively removing all spaces.
  3. Final Answer:

    =SUBSTITUTE(A1, " ", "") -> Option C
  4. Quick Check:

    SUBSTITUTE removes all spaces = correct [OK]
Hint: SUBSTITUTE with space and empty string removes all spaces [OK]
Common Mistakes:
  • Using TRIM to remove all spaces (it only trims edges)
  • Using LEFT without adjusting length
  • Using CONCAT which just joins text
3. Given cell A1 contains " Hello World ", what is the result of the formula =TRIM(A1)?
medium
A. "Hello World"
B. "HelloWorld"
C. " Hello World "
D. "Hello World"

Solution

  1. Step 1: Understand TRIM behavior on spaces

    TRIM removes all leading and trailing spaces and reduces multiple spaces between words to a single space.
  2. Step 2: Apply TRIM to the text

    Original text " Hello World " becomes "Hello World" with one space between words and no extra spaces at start or end.
  3. Final Answer:

    "Hello World" -> Option A
  4. Quick Check:

    TRIM cleans spaces inside and outside = "Hello World" [OK]
Hint: TRIM keeps single spaces inside, removes extras outside [OK]
Common Mistakes:
  • Expecting TRIM to remove all spaces
  • Thinking TRIM leaves original spacing
  • Confusing TRIM with SUBSTITUTE
4. You want to clean data in column A by removing extra spaces and replacing commas with semicolons. Which formula fixes the error in this formula: =SUBSTITUTE(TRIM(A1), ",", ";")?
medium
A. =SUBSTITUTE(A1, ";", ",")
B. =TRIM(A1)
C. =SUBSTITUTE(TRIM(A1), ";", ",")
D. =TRIM(SUBSTITUTE(A1, ",", ";"))

Solution

  1. Step 1: Analyze the original formula order

    The original formula trims first, then substitutes commas. But if commas have spaces, TRIM won't remove spaces after substitution.
  2. Step 2: Correct the order for proper cleaning

    First replace commas with semicolons, then trim spaces to clean all extra spaces after substitution.
  3. Final Answer:

    =TRIM(SUBSTITUTE(A1, ",", ";")) -> Option D
  4. Quick Check:

    Substitute then TRIM cleans fully [OK]
Hint: Substitute first, then TRIM to clean spaces after replacement [OK]
Common Mistakes:
  • Applying TRIM before SUBSTITUTE causing leftover spaces
  • Swapping characters in SUBSTITUTE incorrectly
  • Using only TRIM without SUBSTITUTE
5. You have a list of product codes in column A with inconsistent spaces and dashes, like " AB - 123 ". You want to clean them by removing all spaces and replacing dashes with underscores. Which formula achieves this in one step?
hard
A. =SUBSTITUTE(SUBSTITUTE(A1, "-", "_"), " ", "")
B. =TRIM(SUBSTITUTE(A1, "-", "_"))
C. =SUBSTITUTE(TRIM(A1), "-", "_")
D. =SUBSTITUTE(A1, "_", "-")

Solution

  1. Step 1: Remove all spaces

    Use SUBSTITUTE to replace all spaces " " with empty string "" to remove them completely.
  2. Step 2: Replace dashes with underscores

    Use SUBSTITUTE again to replace "-" with "_".
  3. Step 3: Combine both substitutions

    Nested SUBSTITUTE functions: first replace dashes, then remove spaces, or vice versa. =SUBSTITUTE(SUBSTITUTE(A1, "-", "_"), " ", "") does both correctly.
  4. Final Answer:

    =SUBSTITUTE(SUBSTITUTE(A1, "-", "_"), " ", "") -> Option A
  5. Quick Check:

    Nested SUBSTITUTE cleans spaces and dashes [OK]
Hint: Use nested SUBSTITUTE to fix multiple characters at once [OK]
Common Mistakes:
  • Using TRIM which only removes extra spaces, not all spaces
  • Replacing underscores with dashes instead of the other way
  • Not nesting SUBSTITUTE correctly
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard