Sometimes you may have a column or columns of data that are no longer needed in your worksheet. Like other spreadsheet software, it is easy to delete columns or the data in columns, and easy to undo any accidental deletions.
Topics in this article:
- How to Delete a Column
- Deleting Data but Retaining the Column
- Deleting Primary Columns
How to Delete a Column
There are many quick ways to remove a column from your worksheet. For instance, you can select the column to be deleted, right-click on the column header, and select Delete Column.
Alternatively, select a cell in the column to be deleted, right-click, and choose the Delete Column option instead of the Delete Row option.
Or you can select the column to be deleted and use the Delete Column option in the Edit menu.
In the animation below use the first method to remove our superfluous column. We click on the column drop-down and select "Delete Column D".
Deleting Data but Retaining the Column
You can also delete the data in a column, but retain the empty column. This allows you to retain the formatting and data types of the column, but replace the data in it. To delete data, but not the column in this way, simply select the desired column and press the Delete or Backspace key.
It's easy to fix any mistakes with undo. For instance, if you accidentally delete a column, or the data in a column, and wish to restore it. To undo an action, either use the keyboard shortcut Ctrl + Z, select the Undo button in the Toolbar, or choose the Undo option in the Edit menu.
Deleting Primary Columns
Primary columns cannot be deleted. However, you can change which column is primary and then delete the previously primary column. This is because primary columns are instrumental, with data in the primary column used to uniquely identify the rows in that worksheet.
Deleting columns may affect formulas in your worksheet, which may return a #REF error or require you to change the cell reference. For more details, check out the Formula readjustment article.
If you don't want to delete a column, but you do want to remove it from view, you can use the hide feature to hide columns.