What "clearing lines" means in Excel

When you want to remove a row or column in Excel, you have two choices: delete it (which removes it entirely and shifts everything else up or left) or clear it (which empties the content but leaves the row or column structure in place). Most people mean delete when they say "clear a line," so this guide covers both, since you need to know which one solves your actual problem.

Deleting is permanent and changes your spreadsheet structure. Clearing just wipes out what's inside without reorganizing. If you delete row 5, row 6 becomes the new row 5. If you clear row 5, row 5 stays row 5 but becomes empty.

Key Takeaways

  • Right-click a row or column number and select Delete to remove it entirely and shift everything else over.
  • Select the row or column, press Delete on your keyboard, and everything inside empties but the row or column stays in place.
  • To delete multiple rows or columns at once, click the first one, hold Shift, and click the last one, then right-click and delete.
  • Deleting changes formulas that reference those rows, so check your calculations afterward if you delete near data you depend on.
  • Use Ctrl+Z immediately if you delete the wrong row — undo works right away but gets harder to use the more you do after the mistake.

Delete a single row or column

Click the row number on the left side (like "5") or the column letter at the top (like "C"). The entire row or column turns blue to show it is selected. Right-click on the selected row or column number and a menu appears. Click Delete.

The row or column vanishes. Everything below it (for rows) or to the right of it (for columns) shifts up or left to fill the space. If you had a formula in another cell that referenced something in the deleted row, that formula will now show an error or point to the wrong data.

Clear the contents without deleting the row or column

Click the row number or column letter to select the entire row or column. Press the Delete key on your keyboard. All the content inside disappears, but the row or column structure stays exactly where it was.

This is useful when you want to keep your spreadsheet layout the same but remove old data. If you have formulas that reference this row or column, they will now see empty cells instead of numbers, which might change your results.

Delete multiple rows or columns at once

Click the first row or column you want to remove. Hold down Shift and click the last row or column in the range. All the rows or columns between them (and including them) turn blue. Right-click on any of the selected row or column numbers and click Delete.

All selected rows or columns disappear at once, and everything else shifts to fill the gap. This is faster than deleting one at a time, but be careful — if you select the wrong range, you will delete more than you intended. Undo with Ctrl+Z if you make a mistake.

Delete rows or columns using the Edit menu

Select the row or column you want to remove. Go to the Edit menu at the top and look for Delete Sheet Rows or Delete Sheet Columns (the exact wording depends on your version of Excel). Click it.

This method works the same way as right-clicking, but some people find the menu easier to locate. The result is identical: the row or column is removed and everything shifts.

What happens to formulas when you delete rows

If you have a formula that adds up a range like =SUM(A1:A10) and you delete row 5, Excel automatically adjusts the formula to =SUM(A1:A9) — it removes row 5 from the calculation. This usually works the way you want.

However, if you have a formula that points to a specific cell like =A5 and you delete row 5, that formula will show #REF! error because row 5 no longer exists. Check your formulas after deleting rows near important data. If you see #REF! errors, undo the deletion and try a different approach, like clearing the row instead of deleting it.

Undo a deletion if you made a mistake

Press Ctrl+Z (or Cmd+Z on Mac) immediately after you delete. Excel will restore the row or column and put everything back where it was. This works even if you deleted multiple rows at once.

Undo only works if you have not done anything else in the spreadsheet since the deletion. If you delete a row, then type something new, then realize you made a mistake, undo will only reverse the typing, not the deletion. For this reason, check your work right away after deleting rows or columns.

Frequently Asked Questions

Can I delete a row without deleting the entire row?

Yes. Select just the cells you want to empty (not the whole row), then press Delete. Only those cells clear out. If you want to remove the entire row structure, you must click the row number itself and then delete.

What is the difference between Delete and Clear All?

Delete removes the row or column entirely and shifts everything else. Clear All (or just pressing Delete) empties the contents but leaves the row or column in place. Use Delete when you want to reorganize your spreadsheet. Use Clear when you just want to wipe out old data.

Will deleting a row break my pivot table?

If the pivot table is based on the data in that row, deleting the row will change the pivot table's results. If the row is separate from the pivot table data, it will not affect it. When in doubt, clear the row instead of deleting it, or move the data to a different location before deleting.

Can I delete hidden rows?

Yes. Hidden rows delete the same way as visible ones. Right-click the row number and select Delete. The hidden row disappears along with any visible rows you selected. If you want to see what you are deleting first, unhide the rows by selecting the rows around them, right-clicking, and choosing Unhide.

How do I delete a row in Excel on my phone or tablet?

Open the spreadsheet in the Excel app. Long-press the row number to select the entire row. Tap the three dots menu and choose Delete. The row is removed. The process is the same on both iPhone and Android, though the exact menu location may vary slightly depending on your app version.