A CSV can hold two columns with the same header, such as two columns both called Amount, and Google Sheets will import both without complaint. Formulas that refer to a header by name then read the wrong column, and the error is invisible because both columns look right. Check the header row for duplicates before any formula uses it.
What you need
- The imported sheet in Google Sheets
- The source CSV header row
- A note of what each column is meant to hold
Step 1: List the header row and look for repeats
Read the header row left to right and write each name down with its column letter. Any name that appears twice is a duplicate, even if the two columns hold different data.
Step 2: Check what each duplicate column actually holds
Read a few values under each duplicate header and compare them with the source CSV. Work out which column is which, and give each one a distinct name that says what it holds.
Step 3: Rename the headers and update the formulas
Rename the duplicate headers so every name is unique, then check every formula that referred to a header name and point it at the right column. Re-check one result per formula after the rename.
Worked example: synthetic import with two Amount columns
The table below is a synthetic example. It shows the expected result of a duplicate-header check; no sheet was opened.
| Check | Value | Result |
|---|---|---|
| Columns imported | 6 | Source |
| Header names listed | 6 | Two called Amount |
| First Amount column holds | Net amounts | Column C |
| Second Amount column holds | Tax amounts | Column E |
| Headers after rename | Amount net, Amount tax | Both unique |
Expected result (UNTESTED). 2 of 6 columns share the header Amount; the first holds net amounts and the second holds tax amounts. Renaming them Amount net and Amount tax makes every header unique. This check was not run live; the table shows the expected result for the synthetic example.
Limits
- Headers that differ only by case or a trailing space count as duplicates to a formula that matches by name.
- A blank header is also a duplicate if two columns have no header at all.
- Renaming a header breaks formulas that refer to it by name; update them in the same pass.
- A header row imported as data, rather than as headers, hides the duplicates in row 1.
