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
- How to Delete Multiple Columns
- 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".
How to Delete Multiple Columns
Spreadsheet.com also allows you to delete multiple columns of data at one time. This can be especially useful if you’ve imported a large dataset and only need to keep a subset of the information, or if you’re trying to clean a messy dataset.
First, select the columns you wish to delete by clicking on one column and dragging over the adjacent columns to be deleted. Next, open the column drop-down . You can access the drop-down from any of the selected columns. Finally, select the Delete columns option at the bottom of the drop-down.
If your multi-column selection includes your primary column, the “Delete columns” option will not be available since your primary column cannot be deleted.
It’s important to remember that deleting columns removes the data from your spreadsheet entirely. If you don’t want to see columns temporarily but may need to reference them later, use the Hide columns option instead.
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.