Edit a formula by clicking the cell and typing in the formula bar
To change a formula in Excel, click the cell that holds the formula you want to edit. Look at the top of the screen — you'll see the formula bar, a white box that shows the formula's contents. Click inside that formula bar and edit the text directly, then press Enter when you're done. Excel will recalculate the result using your new formula.
If you prefer to edit inside the cell itself, double-click the cell. The formula will appear right there with a cursor, and you can make changes the same way. This method is useful when you want to see which cells the formula references highlighted in color on your spreadsheet.
A third option is to press F2 while the cell is selected. This puts you in edit mode when ready, whether you prefer working in the cell or the formula bar.
Key Takeaways
- Click the cell containing the formula, then click in the formula bar at the top to edit the formula text directly.
- Double-clicking the cell lets you edit the formula inside the cell itself, and Excel highlights the cells being referenced in color.
- Pressing F2 enters edit mode for the selected cell without requiring a mouse click.
- Press Enter to confirm your changes; Excel will recalculate the result when ready.
- Use Escape to cancel edits and keep the original formula unchanged.
Change part of a formula without retyping the whole thing
When you only need to change one part of a longer formula, you don't have to delete everything and start over. Click in the formula bar and use the arrow keys to move your cursor to the part you want to change. Then select the text you want to replace by holding Shift and pressing the arrow keys, or by clicking and dragging. Type your replacement text and press Enter.
For example, if your formula is =SUM(A1:A10)+B5 and you want to change it to =SUM(A1:A10)+C5, click in the formula bar, move to the B, select it, type C, and press Enter. This is much faster than retyping the entire formula.
Replace cell references in a formula
If your formula refers to the wrong cells, you can change those references without touching the rest of the formula. Click the cell with the formula, then click in the formula bar. Find the cell reference you want to change — it will look like A1, B5, or Sheet2!C10.
Select that reference by double-clicking it or by clicking and dragging. Then type the new cell reference and press Enter. Excel will when ready recalculate using the new cell.
You can also click directly on the cell reference in the formula bar, and Excel will highlight the cell it refers to on your spreadsheet with a colored border. This helps you confirm you're changing the right reference before you make the edit.
Change a formula that's copied to multiple cells
If you've copied a formula to many cells and now need to change it, you have two choices. If the change should explore to all copies, edit the original formula in the first cell, then copy it again to all the cells that need it. Excel will adjust the cell references automatically for each row or column.
If only some of the copies need to change, edit each one individually by clicking it and using the formula bar. This takes longer but gives you control over which cells get the new formula.
A faster approach for many cells is to select all the cells with the formula you want to change, then type the new formula and press Ctrl+Enter (or Cmd+Enter on Mac). This applies the same formula to every selected cell at once, adjusting references for each row or column automatically.
Use Find and Replace to change formulas across your spreadsheet
If you need to change the same cell reference or function name in many formulas at once, use Find and Replace. Press Ctrl+H (or Cmd+H on Mac) to open the Find and Replace dialog. Type the text you want to find — for example, a cell reference like A1 or a function name like SUM.
Type the replacement text in the Replace field. Before you replace everything, click Replace to change just one formula and check that it worked correctly. If it looks right, you can click Replace All to change every matching formula in your spreadsheet at once.
Be careful with Find and Replace on formulas. If you search for a short reference like A1, it might match parts of longer references like A10 or A100. Use the Match Entire Cell Contents option if your version of Excel has it, or replace one at a time to stay safe.
Undo a formula change if something goes wrong
If you change a formula and the result doesn't look right, press Ctrl+Z (or Cmd+Z on Mac) to undo the change. Excel will restore the previous formula. You can undo multiple times to go back several steps if needed.
If you've already closed the file, you cannot undo changes from a previous session. This is why it's a good idea to save a backup copy of important spreadsheets before making large changes to formulas.
Common mistakes when editing formulas
The most common mistake is forgetting to press Enter after typing your new formula. If you click away or switch to another cell without pressing Enter, Excel will discard your changes and keep the old formula. Always press Enter to confirm your edits.
Another frequent error is accidentally changing a cell reference when you meant to change something else. For example, if you meant to change SUM to AVERAGE but accidentally changed A1 to B1 instead, your formula will calculate the wrong cells. Use Find and Replace carefully, or edit one formula at a time until you're comfortable with the process.
Copying a formula to new cells and then editing the original can be confusing. Remember that the copies won't update automatically — if you change the original formula after copying it, the copies keep their old version. Edit the original first, then copy it again if you want all versions to match.
Frequently Asked Questions
What's the difference between editing in the cell and editing in the formula bar?
Both methods change the formula the same way. Editing in the formula bar is cleaner and easier to read for long formulas. Editing in the cell (by double-clicking) shows you colored borders around the cells being referenced, which helps you understand what the formula is using.
Can I change a formula without losing the formatting of the cell?
Yes. Changing the formula does not affect the cell's color, font, borders, or number format. The formula change only updates what the cell calculates, not how it looks.
If I change a formula, will it affect other cells that reference this one?
Yes. If another cell contains a formula that refers to the cell you just edited, that other cell will recalculate using the new result. This is usually what you want, but it's worth checking if you're not sure.
How do I change a formula back to a plain number?
Click the cell, click in the formula bar, delete the entire formula, and type a number instead. Press Enter. The cell will now contain a static number that won't change if other cells update.
Can I see what a formula looked like before I changed it?
Only if you haven't saved the file yet. Press Ctrl+Z to undo and restore the previous formula. Once you save and close the file, the old formula is gone unless you have a backup copy.