A CSV with blank rows scattered through it breaks sorting, filtering and totals, because Excel treats each block as a separate table. Removing the blanks in one pass, rather than deleting them one by one, leaves a single tight table that formulas can cover.
Prerequisites
- Excel
- The CSV opened in Excel
- A copy of the source file, so the original stays untouched.
Steps
- Select the data range and press Ctrl+End to see how far the used range extends beyond the real data.
- Select the range, press F5, Special, Blanks, to select all blank cells in the range.
- Right-click and choose Delete, Entire row, to remove the blank rows, then repeat for blank columns.
- Check the row count against the source and confirm the first row holds the headers.
- Save the cleaned file as .xlsx and keep the original CSV.
Worked example: Fictional class register after removing blanks
The practice table below is a fictional five-student register after cleaning. The count column is 1 per student, and the total is the number of students. The table below is fictional practice material, with fictional values. It is the expected result, worked out by hand, not a run of any tool.
| Student | Count |
|---|---|
| Farah | 1 |
| George | 1 |
| Hannah | 1 |
| Ivan | 1 |
| Julia | 1 |
| Total | 5 |
Expected result. Five students, no blank rows, and the count is 5.
Limits
- A blank row can be a deliberate separator between two tables in one sheet, so check the source before deleting.
- Deleting entire rows can remove data in columns outside the selected range, so select the range first.
