The fastest way to delete a line in Excel

To delete a row or column in Excel, right-click on the row number or column letter you want to remove, then select Delete from the menu. The entire row or column disappears, and everything below or to the right shifts up or left to fill the space. This works the same way in Excel on Windows, Mac, and the web version.

If you need to delete multiple rows or columns at once, click on the first one, then hold Shift and click on the last one to select the range. Right-click and choose Delete, and all of them vanish in one action.

You can also use the menu instead of right-clicking: select the row or column, go to the Home tab, click the dropdown arrow next to Delete, and choose either Delete Rows or Delete Columns.

Key Takeaways

  • Right-click the row number or column letter and select Delete to remove it instantly.
  • Select multiple rows or columns by clicking the first, holding Shift, and clicking the last, then delete them all at once.
  • Deleting a row or column shifts everything below or to the right upward or leftward automatically.
  • You can undo a deletion by pressing Ctrl+Z (Windows) or Command+Z (Mac) immediately after.

Deleting rows versus clearing their contents

Deleting a row removes it entirely from the spreadsheet and shifts everything up. Clearing a row keeps the row in place but erases only the data inside it. Most of the time you want to delete, not clear, because an empty row still takes up space and can break formulas or sorting.

To clear a row without deleting it, select the row, press Delete, and the cells empty but the row stays. To delete the row itself, right-click and choose Delete instead. The difference matters if you have formulas that reference specific row numbers — deleting changes those references, while clearing does not.

Selecting and deleting non-adjacent rows or columns

If the rows or columns you want to delete are not next to each other, click the first one, then hold Ctrl (Windows) or Command (Mac) and click each additional one. They will all highlight in blue. Right-click any of the selected rows or columns and choose Delete, and Excel removes all of them at once.

This is faster than deleting them one at a time, especially if you have many scattered rows to remove. Excel will shift everything up or left after the deletion is complete.

What happens to formulas when you delete a row or column

If a formula in another cell references a deleted row or column, Excel shows #REF! error in that cell. For example, if a formula says =A1+B1 and you delete column B, the formula becomes =A1+ and displays an error because column B no longer exists.

Before deleting rows or columns that other formulas depend on, search your spreadsheet for any references to them. You can use Ctrl+H (Windows) or Command+H (Mac) to open Find and Replace and search for the column letter or row number. If you delete by accident, press Ctrl+Z or Command+Z immediately to undo.

Deleting rows based on a condition

Excel does not have a built-in "delete rows where" feature, but you can sort or filter to group the rows you want to remove, then delete them together. Click any cell in your data, go to the Data tab, and choose Filter. Click the dropdown arrow in the column header, uncheck the values you want to keep, and only the rows you want to delete will show. Select all visible rows, right-click, and delete them.

After deletion, remove the filter to see the remaining data. Be careful with this method because it is easy to delete more than intended — always review what is visible before you delete.

Recovering deleted rows or columns

If you delete a row or column by mistake, press Ctrl+Z (Windows) or Command+Z (Mac) immediately. This undoes the deletion and brings the row or column back. You can undo multiple times to go back several steps if needed.

If you have already saved the file after deleting, you cannot undo. Some versions of Excel keep a version history if you are using OneDrive or SharePoint, which lets you restore an earlier version of the file. Check the File menu for Version History or Restore options.

Deleting entire rows or columns versus partial ranges

When you right-click a row number or column letter and delete, you remove the entire row or column from top to bottom. If you only want to delete data in certain cells within a row, select just those cells instead, then press Delete to clear them without removing the row itself.

For example, if you want to keep row 5 but erase only cells A5 through C5, click on A5, drag to C5, and press Delete. The row stays in place, but those three cells become empty. This is different from right-clicking the row number 5 and deleting the whole row.

Frequently Asked Questions

Can I delete a row without shifting everything up?

No. When you delete a row in Excel, everything below it automatically shifts up to fill the gap. If you want to keep the row but remove only its contents, select the row and press Delete instead of right-clicking and choosing Delete.

What is the keyboard shortcut to delete a row?

There is no single keyboard shortcut that works across all versions of Excel. The fastest method is to right-click the row number and select Delete. On Windows, you can also select the row, right-click, and press D, but this varies by version.

Can I delete a row if it contains a formula that other cells depend on?

Yes, but cells that reference the deleted row will show a #REF! error. Before deleting, check whether any formulas in other cells point to that row. If they do, you may need to update those formulas first or delete the dependent cells as well.

How do I delete multiple non-consecutive rows at once?

Click the first row number, then hold Ctrl (Windows) or Command (Mac) and click each additional row number you want to delete. All of them will highlight. Right-click and choose Delete, and Excel removes all selected rows in one action.

Is there a way to delete rows based on their values?

Excel does not have an automatic "delete rows where value equals X" feature, but you can use AutoFilter to hide rows that do not match your criteria, then select and delete only the visible rows. Go to the Data tab, choose Filter, and uncheck the values you want to keep.