0
0
Google Sheetsspreadsheet~15 mins

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

Choose your learning style9 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.