Data Cleaning
Import CSV Into Google Sheets Cleanly
Upload CSV without broken dates and split columns — import settings, SPLIT, and TRIM pass before VLOOKUP or pivots.
CSV exports from shops, banks, and CRMs often arrive with merged name fields, US dates, or leading zeros stripped from SKUs. Fix structure at import time instead of debugging #N/A later.
Method 1 — File upload (quick)
- File → Import → Upload → select
.csv - Import location: Replace current sheet or Insert new sheet
- Separator type: Comma (or Semicolon if European export)
- Convert text to numbers, dates, and formulas: check ON for numeric columns
- Import
If SKUs like 00124 become 124, see "Preserve leading zeros" below.
Method 2 — IMPORTDATA for a public URL
=IMPORTDATA("https://example.com/export.csv")Only works if the URL is publicly reachable without login. Refresh when the file updates.
Split "Last, First" into two columns
Column A contains Lee, Sam. Column B:
=TRIM(SPLIT(A2, ","))In Google Sheets, SPLIT spills into B2 and C2. Excel: use Data → Text to Columns (Alt+A, E) with comma delimiter.
Parse dates that import as text
If B2 shows 03/01/2026 as left-aligned text:
=DATEVALUE(B2)Format column as Date. US vs EU ambiguity: if day/month swap, fix locale at import or use =DATE(RIGHT(B2,4), MID(B2,4,2), LEFT(B2,2)) only when you know the source format.
Preserve leading zeros on SKU
Before import, open CSV in a text editor and confirm SKUs are quoted: "00124".
In Sheets after bad import:
- Select SKU column
- Format → Number → Plain text
- Re-import, or prepend apostrophe
'00124in source
Better: import to a Raw tab as text, then:
=TEXT(A2, "00000")for fixed-width codes.
TRIM pass before lookup
New column:
=TRIM(CLEAN(D2))Paste values, then VLOOKUP against cleaned SKUs. More on spaces: TRIM and PROPER.
Excel desktop import
Data → Get Data → From File → From Text/CSV
Use preview pane to set column types: set SKU to Text before load. Ctrl+Shift+L adds filters to verify row count after import.
Wrong vs Right
| Wrong | Right |
|---|---|
| Pivot on import tab with blank row 1 header mis-detected | Confirm row 1 headers; delete blank top rows |
| Dates as serial numbers you format as text | Set date format on true date cells |
| VLOOKUP immediately on raw column | TRIM/CLEAN helper column → values → lookup |
Next
Feed cleaned rows into pivot table intro or inventory tracker.