New Tool Radar

AI for Data & Spreadsheets

How to Check the Column Count of an Imported Sheet in Excel

Check the column count of an imported sheet in Excel against the source file before using it.

Schematic with three steps: Count the columns in the source file; Count the columns in the imported sheet; Find the missing or merged column if.

An import can silently drop a column or merge two columns into one, and the sheet still looks complete because the remaining columns are in order. Counting columns is the fastest way to catch that: the imported sheet must have exactly as many columns as the source file. Count first, then check the values.

What you need

  • The imported sheet in Excel
  • The source file, open in a text editor or its own program
  • A note of how many columns the source has

Step 1: Count the columns in the source file

Open the source file in a text editor and count the fields on the header line, or count the columns in the source program. Write the number down with the name of the last column.

Step 2: Count the columns in the imported sheet

In Excel, select the header row and count the filled cells, or press Ctrl+End to find the last used column. Write the count down next to the source count.

Step 3: Find the missing or merged column if the counts differ

If the imported count is smaller, compare the headers one by one with the source headers to find which column is missing or which two were merged. Re-import with the right delimiter or breaks rather than typing the column back by hand.

Worked example: synthetic import with 8 columns

The table below is a synthetic example. It shows the expected result of a column-count check; no file was imported.

Check Count Result
Columns in the source file 8 Source
Columns in the imported sheet 7 One short
Header missing from the import Notes Last column dropped
Cause found Delimiter inside quotes Notes field holds commas
Columns after re-import 8 Matches the source

Expected result (UNTESTED). the source has 8 columns but the import has 7, because the Notes column was dropped when a comma inside a quoted note was read as a delimiter. Re-importing with the text qualifier set gives 8 columns. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • A trailing empty column in the source may not appear in the import at all; check whether it held data.
  • Merged header cells in the source can become one column or a blank header after import.
  • Matching column counts do not prove the values are right; check values next.
  • A column that arrives empty may have been skipped by the wizard; check the wizard’s column settings.

Sources

See all