Home/Coding & Tech Skills

I Clean Messy Data in Google Sheets Fast — Here Are My 9 Tricks

coding-tech-skills · Coding & Tech Skills

I still remember the afternoon I spent four hours trying to reconcile a sales report that had been copy-pasted from three different CRM exports. Names were misspelled, dates looked like a toddler had typed them, and empty cells lurked everywhere. By the time I finally cleaned it up, I had no energy left to actually analyze the data. That’s when I decided I needed a systematic approach — not just one-off fixes, but a set of repeatable tricks I could run through in minutes. Over the years, I’ve built a personal toolkit of Google Sheets data cleaning methods that turn chaos into clarity fast. Here are my nine go-to tricks, no fluff, just what actually works.

Trick #1: Spot and Strip Invisible Characters with TRIM, CLEAN, and REGEXREPLACE

The first thing I do when I open a messy sheet is run the TRIM function on every text column. TRIM removes leading, trailing, and excessive internal spaces — but it doesn’t catch everything. Non-printable characters, like line breaks or tab remnants from a bad import, hide in plain sight. That’s where CLEAN comes in. =CLEAN(A2) strips out those invisible control characters. For truly stubborn junk — like stray punctuation or extra spaces between words — I use REGEXREPLACE. =REGEXREPLACE(A2, "[^a-zA-Z0-9\s]", "") removes everything except letters, numbers, and spaces. I once had a column of product codes that looked clean but wouldn’t match in a VLOOKUP. TRIM and CLEAN solved it in under a minute.

Trick #2: Fix Date and Number Inconsistencies with TEXT and TO_DATE

Dates are the bane of my data-cleanup existence. I’ve seen “Jan 5, 2024,” “01/05/2024,” and “2024-01-05” in the same column. My fix: use =TO_DATE(DATEVALUE(A2)) if the cell is already a date but misformatted. For text strings, I combine TEXT and DATEVALUE. For example, =TEXT(DATEVALUE(A2), "YYYY-MM-DD") forces everything into ISO format, which sorts and filters perfectly. Numbers stored as text are another common headache. I multiply the cell by 1: =A2*1. If that fails, I use =VALUE(A2). After that, I copy and paste values to lock in the conversion. This one trick alone saved me from a week of manual reformatting when I inherited a legacy database export.

Comparison of date formats before and after standardization in a spreadsheet

My Go-To Steps for Splitting and Recombining Columns

One of the most common data messes I see is merged information in a single cell — like “John Smith, 123 Main St, Anytown, USA” in one column. Splitting that cleanly is essential, but so is recombining when needed. Here’s my workflow.

Trick #3: Use SPLIT and JOIN to Break Apart Messy Cells Cleanly

SPLIT is my first tool for any delimited data. =SPLIT(A2, ",") breaks that combined cell into separate columns for name, address, city, and country. But SPLIT can leave trailing blanks or inconsistent results if the delimiter varies. That’s when I reach for REGEXREPLACE first to normalize the separator. For example, if some entries use commas and others use semicolons, I run =REGEXREPLACE(A2, "[,;]", ",") to make them uniform, then SPLIT. On the flip side, JOIN reassembles columns into one string with a consistent delimiter. =JOIN(" - ", B2:D2) creates a clean “Name - Address - City” string. I use this when I need to create a unique identifier or a mailing label from separate fields.

Trick #4: Merge Columns Without Losing Data with TEXTJOIN and CONCATENATE

When merging columns, CONCATENATE is fine for simple cases, but it fails if any cell is blank — you get an extra delimiter or a gap. TEXTJOIN solves that beautifully. =TEXTJOIN(" ", TRUE, B2:D2) skips empty cells and inserts spaces only between non-blank entries. I once had a spreadsheet with first name, middle initial, and last name in separate columns, but many rows lacked a middle initial. TEXTJOIN produced a clean full name every time. For more complex merges, I wrap TEXTJOIN inside IF statements to handle conditional data, like only including a suffix if one exists. This level of control keeps my output consistent without manual tweaking.

Screenshot showing columns before and after merging using TEXTJOIN and SPLIT

The Quickest Way to Detect and Remove Duplicates (Without Manual Hunting)

Duplicate rows are a productivity black hole. I used to scroll through thousands of rows looking for repeats — until I automated it.

Trick #5: Use Conditional Formatting to Highlight Duplicates in Seconds

Before I delete anything, I want to see what’s duplicated. Conditional formatting is perfect for this. I select the column or range, go to Format > Conditional formatting, choose “Custom formula is,” and enter =COUNTIF(A:A, A2)>1. Sheets instantly highlights every duplicate in a color I choose. This non-destructive step lets me eyeball the duplicates and decide if they’re true duplicates (same data) or false positives (same value but different context). I once caught a set of duplicate customer IDs that had different addresses — turned out to be two different people with the same ID. Conditional formatting saved me from a costly merge.

Trick #6: UNIQUE and COUNTIF Combo for Advanced Duplicate Analysis

For a more analytical approach, I use =UNIQUE(A:A) to extract a list of distinct values, then =COUNTIF(A:A, UNIQUE(A:A)) to count occurrences. I put these in a helper sheet to get a bird’s-eye view of duplication patterns. If I see a value appearing 10 times but it should appear only once, I investigate. This combo is especially useful for cleaning customer lists or inventory codes where duplicates are errors. I also use FILTER with COUNTIF to isolate only the duplicates: =FILTER(A:A, COUNTIF(A:A, A:A)>1) gives me every row that has a twin. From there, I can decide to remove or merge them.

Handling Blanks, Outliers, and Text Case Chaos

Blanks and outliers can derail calculations and charts. Here’s how I deal with them systematically.

Trick #7: Fill Blank Cells Quickly Using IF and VLOOKUP or a Simple Script

When I have a column with sporadic blanks — say, a category that should be the same for a group of rows — I use IF and VLOOKUP to fill them. For example, if column A has categories and column B has blanks that should match the category above, I use =IF(B2="", A2, B2) to copy the category down. For more complex lookups, a helper column with =VLOOKUP(unique_key, reference_table, 2, FALSE) can fill blanks based on another table. If I need to fill every blank in a column with a default value (like “N/A”), I use =IF(ISBLANK(A2), "N/A", A2). This trick has saved me hours of manual data entry when dealing with incomplete exports.

Trick #8: Normalize Text Case Instantly with UPPER, LOWER, and PROPER

Inconsistent capitalization — “john smith,” “John Smith,” “JOHN SMITH” — wreaks havoc on sorting and matching. I run =UPPER(A2) to force everything uppercase for IDs or codes, =LOWER(A2) for email addresses, and =PROPER(A2) for names or titles. I always create a new column with the converted text, then copy and paste values over the original. One caveat: PROPER can mess up names like “McDonald” or “O’Brien,” so I review the results after. For large datasets, I use a helper column with an IF statement to flag cells where the original doesn’t match the PROPER output, so I can manually fix proper nouns.

Trick #9: Validate and Flag Outliers with QUARTILE or IF + STDEV

Outliers can be genuine insights or data entry errors. I use statistical functions to flag them without removing them blindly. For numeric data, I calculate the interquartile range: =QUARTILE(A:A, 1) for Q1 and =QUARTILE(A:A, 3) for Q3. Then I create a helper column: =IF(OR(A2 < Q1 - 1.5*IQR, A2 > Q3 + 1.5*IQR), "Outlier", ""). This flags values that fall outside the typical range. For smaller datasets, I use standard deviation: =IF(ABS(A2 - AVERAGE(A:A)) > 2*STDEV(A:A), "Outlier", ""). I once flagged a sales figure that was 10 times higher than the average — turned out to be a decimal point error. This approach lets me investigate without losing potentially important data.

How I Prevent Messy Data from Coming Back

Cleaning data is one thing; keeping it clean is another. I now set up data validation rules on every sheet I share. For example, I restrict a date column to valid dates using Data > Data validation > Date. For text columns, I create dropdown lists using Data > Data validation > List from a range. This prevents users from typing “N/A” in a field that should have a date. I also use import settings when pulling data from external sources. In Google Sheets, when you import a CSV, you can set parsing rules to treat columns as plain text or numbers. I always preview the import and adjust data types before loading. Finally, I add a “Last Cleaned” timestamp with =NOW() in a header row, so I know when the sheet was last sanitized. These habits have cut my cleaning time by 80%. If you’re constantly wrestling with messy spreadsheets, start with TRIM and CLEAN on your next import — you’ll be amazed at how much junk disappears instantly. Worth bookmarking this page for your next data cleanup session.