Bird
Raised Fist0
Google Sheetsspreadsheet~15 mins

Why text functions clean messy data in Google Sheets - Business Case Study

Choose your learning style10 modes available
Scenario Mode
👤 Your Role: You are a data analyst at an online retail company.
📋 Request: Your manager wants you to clean up customer data that has inconsistent text formatting before analysis.
📊 Data: You have a list of customer names and email addresses with extra spaces, inconsistent capitalization, and some unwanted characters.
🎯 Deliverable: Produce a clean version of the customer names and emails using text functions so the data is consistent and ready for reporting.
Progress0 / 5 steps
Sample Data
Customer NameEmail Address
alice JOHNSON ALICE.johnson@Example.com
Bob smithbob_smith @example.COM
CHARLIE browncharlie.brown@example.com
diana Princediana.prince @ example.com
edward NORTONedward.norton@example.com
fiona O'connorfiona.o'connor@example.com
george WASHINGTON george.washington@example.com
Hannah Montana hannah.montana@example.com
1
Step 1: Remove extra spaces from customer names and emails using the TRIM function.
In a new column for clean names, enter =TRIM(A2) and drag down. For clean emails, enter =TRIM(B2) and drag down.
Expected Result
Customer names and emails no longer have leading or trailing spaces.
2
Step 2: Standardize customer names to proper case (first letter uppercase, rest lowercase) using the PROPER function.
In a new column, enter =PROPER(TRIM(A2)) and drag down.
Expected Result
Names like 'alice JOHNSON' become 'Alice Johnson'.
3
Step 3: Convert all email addresses to lowercase for consistency using the LOWER function.
In a new column, enter =LOWER(TRIM(B2)) and drag down.
Expected Result
Emails like 'ALICE.johnson@Example.com' become 'alice.johnson@example.com'.
4
Step 4: Remove any spaces inside email addresses using SUBSTITUTE function.
In a new column, enter =SUBSTITUTE(LOWER(TRIM(B2)), " ", "") and drag down.
Expected Result
Emails like 'bob_smith @example.COM' become 'bob_smith@example.com' with no spaces.
5
Step 5: Combine all cleaning steps into one formula for emails to trim, lowercase, and remove spaces.
=SUBSTITUTE(LOWER(TRIM(B2)), " ", "")
Expected Result
Clean, consistent email addresses ready for use.
Final Result
Clean Customer Data
-------------------
Name             | Email
-----------------|---------------------------
Alice Johnson    | alice.johnson@example.com
Bob Smith        | bob_smith@example.com
Charlie Brown    | charlie.brown@example.com
Diana Prince     | diana.prince@example.com
Edward Norton    | edward.norton@example.com
Fiona O'Connor   | fiona.o'connor@example.com
George Washington| george.washington@example.com
Hannah Montana   | hannah.montana@example.com
✓Extra spaces in names and emails cause inconsistency and errors.
✓Using TRIM removes unwanted spaces around text.
✓PROPER makes names look neat and consistent.
✓LOWER standardizes email addresses to lowercase.
✓SUBSTITUTE removes spaces inside emails to fix formatting.
Bonus Challenge

Create a formula to check if the cleaned email addresses contain exactly one '@' symbol and flag invalid emails.

Show Hint
Use the LEN function combined with SUBSTITUTE to count '@' symbols and IF to flag errors.

Practice

(1/5)
1. What is the main reason to use text functions like TRIM and UPPER in Google Sheets?
easy
A. To clean messy text data by removing extra spaces and standardizing letter case
B. To create charts and graphs from data
C. To perform mathematical calculations on numbers
D. To sort data alphabetically

Solution

  1. Step 1: Understand the purpose of text functions

    Text functions like TRIM remove extra spaces, and UPPER changes text to uppercase, helping clean data.
  2. Step 2: Identify the main goal of cleaning text

    Cleaning messy text makes data easier to read and use, which matches To clean messy text data by removing extra spaces and standardizing letter case.
  3. Final Answer:

    To clean messy text data by removing extra spaces and standardizing letter case -> Option A
  4. Quick Check:

    Text functions clean data = To clean messy text data by removing extra spaces and standardizing letter case [OK]
Hint: Text functions fix spaces and case to clean data fast [OK]
Common Mistakes:
  • Confusing text functions with chart tools
  • Thinking text functions do math calculations
  • Assuming text functions sort data automatically
2. Which of the following formulas correctly removes extra spaces from text in cell A1 in Google Sheets?
easy
A. =SPACES(A1)
B. =REMOVE(A1)
C. =CLEAN(A1)
D. =TRIM(A1)

Solution

  1. Step 1: Recall the function that removes extra spaces

    The TRIM function removes extra spaces from text in Google Sheets.
  2. Step 2: Check the formula syntax

    =TRIM(A1) is the correct syntax to clean spaces in cell A1.
  3. Final Answer:

    =TRIM(A1) -> Option D
  4. Quick Check:

    TRIM removes spaces = =TRIM(A1) [OK]
Hint: Use TRIM to clean spaces, not CLEAN or REMOVE [OK]
Common Mistakes:
  • Using CLEAN which removes non-printable characters, not spaces
  • Typing REMOVE which is not a valid function
  • Assuming SPACES is a function to remove spaces
3. Given cell A1 contains the text " hello World ", what will the formula =UPPER(TRIM(A1)) return?
medium
A. " HELLO WORLD "
B. "HELLO WORLD"
C. "hello world"
D. "Hello World"

Solution

  1. Step 1: Apply TRIM to remove extra spaces

    TRIM(" hello World ") removes spaces at start and end, resulting in "hello World".
  2. Step 2: Apply UPPER to convert text to uppercase

    UPPER("hello World") changes all letters to uppercase: "HELLO WORLD".
  3. Final Answer:

    "HELLO WORLD" -> Option B
  4. Quick Check:

    TRIM then UPPER = "HELLO WORLD" [OK]
Hint: TRIM cleans spaces first, then UPPER changes case [OK]
Common Mistakes:
  • Forgetting TRIM removes spaces, so spaces remain
  • Using LOWER instead of UPPER
  • Expecting original case to stay after UPPER
4. You want to clean text in cell B2 by removing extra spaces and converting all letters to lowercase. Which formula has an error?
medium
A. =LOWER(B2, TRIM())
B. =TRIM(LOWER(B2))
C. =LOWER(TRIM(B2))
D. =LOWER(B2)

Solution

  1. Step 1: Check correct function nesting syntax

    Functions should be nested like LOWER(TRIM(B2)) or TRIM(LOWER(B2)), both valid.
  2. Step 2: Identify syntax error in =LOWER(B2, TRIM())

    =LOWER(B2, TRIM()) uses LOWER(B2, TRIM()), which is invalid syntax because LOWER takes only one argument.
  3. Final Answer:

    =LOWER(B2, TRIM()) -> Option A
  4. Quick Check:

    Incorrect function arguments = =LOWER(B2, TRIM()) [OK]
Hint: Functions take one argument here; no commas inside LOWER [OK]
Common Mistakes:
  • Adding extra arguments inside functions
  • Mixing order of TRIM and LOWER incorrectly
  • Using parentheses wrongly in nested functions
5. You have a list of names in column A with inconsistent spaces and mixed letter cases. Which formula in cell B1 will clean the name in A1 by removing extra spaces, capitalizing the first letter of each word, and making the rest lowercase?
hard
A. =PROPER(A1)
B. =UPPER(TRIM(A1))
C. =PROPER(TRIM(A1))
D. =LOWER(TRIM(A1))

Solution

  1. Step 1: Remove extra spaces with TRIM

    TRIM(A1) removes leading, trailing, and extra spaces inside the text.
  2. Step 2: Capitalize first letter of each word with PROPER

    PROPER converts text to have uppercase first letters and lowercase others.
  3. Step 3: Combine functions correctly

    PROPER(TRIM(A1)) first trims spaces, then applies proper case formatting.
  4. Final Answer:

    =PROPER(TRIM(A1)) -> Option C
  5. Quick Check:

    Trim then Proper case = =PROPER(TRIM(A1)) [OK]
Hint: Use PROPER(TRIM()) to clean spaces and fix capitalization [OK]
Common Mistakes:
  • Using UPPER which makes all letters uppercase
  • Using PROPER without TRIM, leaving extra spaces
  • Using LOWER which makes all letters lowercase
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