How to compare formulas between two Excel files
Comparing only the numbers on screen misses the change that matters most. Say cell B10 held
=SUM(B2:B9) and showed 100, and someone typed 100 over it. Both versions look identical, but the new one
will not update when B2 changes. To catch this you have to compare formulas.
This page is published by the makers of FormulaGuard, the tool in method 4. Methods 1 to 3 do not need it.
1. Show formulas and read them side by side
In each workbook press Ctrl + ` (the key above Tab) to switch between results and formulas, then arrange the two windows next to each other. This works for a short sheet. On anything larger it is easy to miss one changed cell.
2. Flag differences with FORMULATEXT
FORMULATEXT returns a cell's formula as text. Keep both workbooks open, add a new sheet, enter this in cell A1 and fill it across the range you want to check. Replace the file and sheet names with yours.
=IFERROR(FORMULATEXT('[old.xlsx]Sheet1'!A1), '[old.xlsx]Sheet1'!A1&"")<>IFERROR(FORMULATEXT('[new.xlsx]Sheet1'!A1), '[new.xlsx]Sheet1'!A1&"")
TRUE marks a cell that differs, either in its formula or, for cells without one, in its value. The limits:
- You need both workbooks open. FORMULATEXT returns an error for a closed one, so the formula falls back to that file's values: a formula replaced by the same number then shows FALSE, and unchanged formulas can show TRUE.
- Microsoft notes the same error when sheet protection stops a formula from being displayed.
- It can miss a number retyped as text, such as 100 turned into the text "100".
- One inserted row shifts everything below it, so many cells show as different.
- The comparison ignores upper and lower case, and each sheet needs its own check.
- A cell holding a typed error value shows an error instead of TRUE or FALSE.
3. Use Microsoft Spreadsheet Compare
Spreadsheet Compare puts two workbooks next to each other and highlights differences in values, formulas, formatting and macros. Microsoft states it is available “only in Excel for Windows”, in Microsoft 365 Apps for enterprise and equivalent editions (source). On a Mac, see Spreadsheet Compare on a Mac.
4. Check the two versions with FormulaGuard
Open FormulaGuard and drop in the original and the changed workbook (.xlsx, .xlsm, .xlsb, .xls or .ods). It lists:
- formulas replaced with typed values or cleared, including cases where the number did not change
- formula ranges that changed, such as a SUM that now covers fewer rows, and other formula edits
- new spreadsheet errors such as #REF!
- newly hidden rows and columns, deleted rows and columns, and added or removed sheets
- direct edits, kept apart from cells that only recalculated because something upstream changed
Its Smart Row Align mode is meant for versions where rows were inserted or deleted. Workbooks are read inside your browser and are not uploaded. It does not compare cell formatting or VBA macros. The free web app checks up to 2 worksheets and 500 rows per sheet. Its report is watermarked and lists up to 12 critical or high findings. Pro is a one-time $29. The command-line version needs Node.js 18 or later and checks every sheet and row for free:
npx formulaguard before.xlsx after.xlsx
Which method fits
| Your situation | Method |
|---|---|
| A few dozen cells | 1. Show formulas |
| Same layout, one sheet, no extra tool | 2. FORMULATEXT |
| Windows with an eligible edition, formatting matters | 3. Spreadsheet Compare |
| You want broken formulas ranked by risk, in a web browser | 4. FormulaGuard |
Keep an untouched copy of the original before anyone edits it. Every method here needs both versions.
Related: Spreadsheet Compare on a Mac · Check if ChatGPT or Claude overwrote Excel formulas.