Excel Delete Data But Not Formula: How-To
If you want to delete data in Excel but keep the formulas, select the cells with data, press Delete or Backspace, and the formulas will remain intact. This works because Excel treats a cell’s formula and its displayed value as separate layers—clearing the cell removes the value but leaves the formula ready to recalculate.
Why Formulas Survive a Simple Delete
In Excel, every cell can contain either a constant (a number, text, or date) or a formula (something that starts with =). When you press Delete on a cell, Excel clears the cell’s contents—which is the formula if one exists. However, if the cell contains a formula, the formula is the content, so deleting it would remove the formula too. The trick is to delete only the value that the formula produces, not the formula itself. This is done by clearing the cell’s format and value but leaving the formula. But wait—if you press Delete on a cell with a formula, it deletes the formula as well. So how do you delete the data but keep the formula? The answer is to use Clear Contents instead of Delete. Actually, let’s be precise: pressing Delete on a cell with a formula removes the formula. To keep the formula, you must use the Clear Contents command (Home > Clear > Clear Contents), which clears only the value (the result) but leaves the formula. Alternatively, you can use the Find & Select > Go to Special > Constants to select only cells with constant values (not formulas) and then delete them.
How to Clear Only Data (Keep Formulas)
Here are the exact steps to remove data while preserving formulas:
- Select the range of cells that contain the data you want to delete. This can include cells with formulas and cells with raw data.
- Press F5 (or Ctrl+G) to open the Go To dialog.
- Click Special… to open the Go To Special dialog.
- Choose Constants and click OK. This selects only cells that contain constant values (numbers, text, dates) and excludes cells with formulas.
- Press Delete on your keyboard. This clears the selected constants, leaving all formulas untouched.
This method is perfect when you want to clear input cells but keep the calculation cells (formulas) intact. For example, if you have a budget spreadsheet with expense amounts in column B and a SUM formula in column C, you can select the range B2:B10, use Go To Special > Constants, and delete—the SUM formula remains.
Using Clear Contents vs. Delete Key
Many users are confused about the difference between the Delete key and the Clear Contents command. The Delete key is a shortcut for Clear Contents—it removes the cell’s content (formula or value) but leaves formatting and comments. So if you press Delete on a cell with a formula, the formula is gone. To keep the formula, you must either use the Go To Special method above, or if you want to clear only the value of a specific cell that has a formula, you can’t do it directly—you’d have to replace the formula with a value, but that defeats the purpose. The only way to keep a formula while removing its result is to clear the cell’s contents, which removes the formula. So the correct approach is to delete only the constants, as described.
Common Mistakes and Misconceptions
A frequent mistake is pressing Delete on a range that includes formulas, thinking it will only clear the numbers. It won’t—it clears everything, including formulas. Another misconception is that using Clear All (Home > Clear > Clear All) will keep formulas. It won’t; it clears everything. The only way to keep formulas is to avoid selecting them in the first place. Also, be aware that if you have formulas that return blank strings (""), they are still formulas, so they won’t be selected by Go To Special > Constants. That’s usually what you want.
What About Clearing Formatting Only?
If you want to delete the data but keep the formulas and also keep the formatting (like colors, borders), you can use the same Go To Special method, but instead of pressing Delete, you can use Clear > Clear Contents from the Home tab. This does the same thing as the Delete key. If you want to remove formatting but keep data and formulas, use Clear > Clear Formats. If you want to remove everything except formulas, you’d have to use a macro, but that’s beyond the scope of a simple how-to.
Alternatives: Using Find & Replace or VBA
For more control, you can use Find & Select > Go to Special > Constants as described, or you can use a simple VBA macro to clear only constants across a sheet. For example, the following macro clears all constants on the active sheet while leaving formulas intact:
Sub ClearConstants()
On Error Resume Next
ActiveSheet.Cells.SpecialCells(xlCellTypeConstants).ClearContents
End Sub
This is a handy tool if you frequently need to reset input cells without touching formulas. Just be careful: it clears all constants on the entire sheet, so make sure that’s what you want.
Frequently Asked Questions
Why does pressing Delete remove my formulas?
Because in Excel, a formula is the cell’s content. Pressing Delete clears the content, which includes the formula. To keep formulas, you must delete only the cells that contain constants (non-formula values).
Can I undo a delete that removed my formulas?
Yes, press Ctrl+Z immediately after the accidental delete. If you’ve done other actions, you may not be able to undo, but Excel’s undo history can often restore multiple steps.
How do I clear data but keep formulas in a specific column?
Select the column, then use Go To Special > Constants, and press Delete. This will clear all constant values in that column, leaving formulas intact.
Does Clear Contents keep formulas?
No. Clear Contents removes the content of a cell, which includes formulas. It’s the same as pressing Delete. To keep formulas, you must avoid selecting them.
Can I use the Fill Handle to delete data but keep formulas?
No, the Fill Handle copies data or formulas, not delete. To delete, use the methods described above.
Is there a way to delete all data in a sheet but keep all formulas?
Yes, use the VBA macro provided above, or manually select all cells, use Go To Special > Constants, and delete. The macro is more efficient for large sheets.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.