How to Delete Blank Columns in Excel & Google Sheets
Written by
Reviewed by
This tutorial demonstrates how to delete blank columns in Excel and Google Sheets.
Delete Blank Columns
If you have a dataset containing blank columns, you can easily delete them using the COUNTA Function. Say you have the following dataset.
To delete empty columns completely, follow these steps:
- Add one helper row above the dataset, and enter the formula in cell B1:
=COUNTA(B2:B1048576)
This formula counts all non-blank cells in the column.
- Now, copy the formula to the right, through to the last populated column (G).
All blank columns have zeros in the first row.
- Select all columns with a value of 0 in the first row (C and E), right-click the selected area, and choose Delete.
- Now, all blank columns are deleted, and you can delete the helper row.
See also: How to Delete Blank Rows
Delete Blank Columns in Google Sheets
Following exactly the same steps, you can delete blank columns in Google Sheets.
The COUNTA formula is slightly different in Google Sheets; you do not need to add an end row to the formula.
=COUNTA(B2:B)
You can then select the columns that contain a zero and right-click on one of the selected column headers and select Delete selected columns.