Clean Data in Google Sheets With AI: 30 Minutes Back
Clean data in Google Sheets with AI: tell the SheetMagic Chat Agent to remove duplicate emails, split names into first and last, and fix spellings like USA vs United States. A 30-minute export cleanup becomes one message, with no scraping credits used.
Phil Nguyen · 6 min read

To clean data in Google Sheets with AI, open the SheetMagic AI Chat sidebar and describe the fix in one message, for example "remove rows with duplicate emails, split the name column into first and last, and change USA to United States". The Chat Agent runs Google Sheets' own remove-duplicates, split-text and find-and-replace operations for you, so a 30-minute cleanup of a messy export becomes a message or two and the list is ready to import the same hour.
Picture a sales assistant with a 2,000-row lead export. Some leads appear twice with the same email, the full name sits in one column, and the country column mixes "USA", "U.S." and "United States". Fixing that by hand, menu by menu and check by check, takes them about 30 minutes every time a new export arrives, and a duplicate that slips through gets imported, emailed and counted twice. With the Chat Agent, those three fixes are one message, and the cleaning tools themselves cost no scraping credits.
How do I remove duplicates in Google Sheets with AI?
Open your sheet, click the tab with the data, and go to Extensions > SheetMagic > Open AI Chat. Then ask:
Remove duplicate rows based on the email column.
The agent's remove-duplicates tool works on a range and can compare chosen columns, such as just the email column, or every column in the range. Comparing on email alone removes the second row for an email address even when the two rows have different job titles. Comparing all columns only removes rows that are identical everywhere.
Can AI split names or addresses into columns?
Yes. Ask:
Split column B (full name) into first and last name on the space.
The split tool takes a range and a delimiter: comma, semicolon, period, space, or any single character such as | or -. Leave the delimiter out and it is detected automatically. The same tool splits "City, State" addresses on the comma.
For inconsistent spellings, use find and replace:
In column E, replace "U.S." and "USA" with "United States". Only match whole cells.
You can make the match case-sensitive or limit it to cells whose entire content matches. Leave out the range and it searches the whole open tab.
The agent has more tools for tidying up: sort a range by any column, highlight rows with conditional formatting (for example, blank emails in red), and filter rows to read back only the ones that match a condition, such as every lead with no phone number. Filtering reads; it does not change the sheet.
How do I keep the original data safe?
Remove duplicates, split and find-and-replace run straight away, with no approval step. Remove duplicates deletes rows, so keep a copy first. Start with:
Duplicate this sheet as Leads original, then clean the Leads tab.
The duplicate tool copies the tab under a new name, so the raw export stays one click away.
The agent does stop and ask before it writes cells, autofills or clears contents over a block that already holds data (by default, 10 or more filled cells).
What can you do with the cleaned list?
- Import to your CRM without paying for duplicates. If your CRM or email tool charges by contact count, every duplicate removed before import is one fewer contact you pay for, and one fewer person who gets the same email twice.
- Personalise by first name. With first and last names in their own columns, a mail merge greets "Hi Jane" instead of "Hi Jane Smith", which reads like a person wrote it.
- Count leads per country correctly. Once "USA", "U.S." and "United States" are one value, a count or pivot by country is right, so territory planning is based on the real numbers. You can then ask the agent for a pivot of leads by country.
- Reuse the same message next month. Paste next month's export into the same tab and send the same prompt. In the sales assistant example, that is most of the 30 minutes back every time.
What does it cost?
Remove duplicates, split text to columns, find and replace, sort and duplicate sheet have no cost of their own: no scraping credits and no extra charge. The chat turn uses AI tokens from your plan when it runs on SheetMagic's key, and deducts nothing from your SheetMagic tokens if you use your own API key (BYOK).
The Chat Agent is on every plan, including Free. The Free plan includes 20,000 AI tokens. The Solo plan is $20 a month and includes 3,250,000 AI tokens a month.
What goes wrong?
- Near-duplicates. A stray space at the end of an email can keep two copies of one address from matching. Ask the agent to add a helper column with
=LOWER(TRIM(C2))filled down, then remove duplicates on that column. - Partial replacements. Replacing "US" with "United States" without whole-cell matching also changes "USA" into "United StatesA". Ask for whole-cell matches when you fix country or state codes.
- No room for the split. Give the split an empty column to fill: ask the agent to insert an empty column to the right of the name column first, so the last names cannot land on top of other data.
- Middle names. Splitting "Mary Ann Smith" on spaces gives three columns, not two. Sort by the third column afterwards to find and fix those rows.
- Checking the result. Ask "how many rows does this tab have now?" before and after removing duplicates. The agent can read the sheet's dimensions and tell you.
- Very large sheets. The agent reads up to 25,000 cells of the open tab when you send a message, and only the first rows of anything bigger. A 2,000-row export with 6 columns is 12,000 cells and fits. For a bigger sheet, name the full range in your message, for example "remove duplicates in A1:F40000 based on column C".
For more ways to hand off sheet chores, see the AI Chat Agent guide and the AI in Google Sheets pillar. For analysis once the data is clean, see the data analysis guide.
Text and scraping formulas run on the free allowance. Install from the Google Workspace Marketplace, no card, no expiry.
Install free for Google SheetsAbout the author
Phil NguyenPhil builds SheetMagic, the Google Sheets add-on that brings AI and web scraping into the spreadsheet, used by 6,000+ people. He writes these guides from the formulas he runs on his own sheets.
