How to Compare Two Excel Files for Differences
In this article
Comparing two Excel files lets you quickly find every cell that changed between two versions of a spreadsheet, such as a budget sent back and forth for review. Excel has a built-in tool for this: open both files, then go to Home > Compare Files in the dedicated Compare feature, or use the simpler formula and conditional formatting methods below if you do not have that version. You do not need any add-ins for the formula method, which works in every modern Excel.
What You'll Need
- Two Excel workbooks you want to compare (both saved and closed or open, depending on the method)
- Excel on Windows or Mac; the Compare Files tool described in Method 2 requires a Microsoft 365 subscription with the Inquire add-in available
- A few minutes; large files take longer but the steps are the same
Step-by-Step
Method 1: Compare with a formula (works in every version)
- Open both workbooks in Excel at the same time.
- In a third, blank workbook (or an empty sheet in one of the two), click cell A1.
- Type a formula that tests whether the two files match cell by cell, for example:
='[Budget old.xlsx]Sheet1'!A1='[Budget new.xlsx]Sheet1'!A1. Adjust the file and sheet names to yours. TRUE means the cells match, FALSE means they differ. - An easier variant that avoids exact file names: type
=in the blank cell, then click cell A1 in the first file, type=again, and click cell A1 in the second file. Excel builds the references for you. - Drag the formula across and down to cover the same range as your data. Use Ctrl + Shift + End or Ctrl + D / Ctrl + R to fill quickly on large ranges.
- Filter the results column or use Find (Ctrl + F) to search for FALSE and jump straight to the differences.
Method 2: Use Excel's Compare Files tool (Microsoft 365)
- Close both workbooks. The Compare Files tool works on saved files, not open ones.
- In Excel, go to Home > Compare Files. If you do not see it, the Inquire add-in may need to be enabled: go to File > Options > Add-ins, select COM Add-ins in the Manage box, click Go, and tick Inquire. Labels can differ slightly between Excel versions and platforms; this tool is Windows-only.
- In the Compare Files dialog, pick the older file under Compare and the newer file under With, using the browse icons. Swapping them only changes which color marks which file.
- Click OK. Excel opens a results view listing all changes, with differences highlighted in green and additions in purple in the exported report.
- Use the left pane to step through each change, and the export command (Compare > Export Results) to save the list as an Excel report you can share.
Method 3: Highlight differences with conditional formatting
- Open the newer file and select the data range you want to check.
- Go to Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format.
- Enter a formula such as
=A1<>'[Budget old.xlsx]Sheet1'!A1, referencing the top-left cell of your selection. - Click Format, choose a fill color, and click OK. Every cell that differs from the other file is now highlighted in place.
Common Mistakes
- Comparing different sheets. If one file has data on Sheet1 and the other on Sheet2, formulas must reference the correct sheet names, or everything shows as different.
- Forgetting that trailing spaces or different date formats make identical-looking values compare as unequal. Use TRIM to clean text or check the cell format.
- Trying to use the Compare Files tool with unsaved or open workbooks, which causes errors or grayed-out results.
- Comparing .csv files directly. Open them in Excel and save as .xlsx first so formulas and formatting behave predictably.
- Mixing up absolute and relative references when filling a comparison formula, so it checks the wrong cells.
Tips
- Make a copy of both files before comparing if you plan to add helper formulas, so the originals stay untouched.
- For one-off checks of a single column,
=COUNTIF(range, value)or XLOOKUP can tell you which entries exist in one file but not the other. - If you only need to know whether two files are identical overall, compare them with EXACT on concatenated columns, or check file sizes and last-modified dates in File Explorer as a fast first pass.
- Power Query (Data > Get Data) is the best option for comparing very large tables: load both tables and use Merge to find matching and non-matching rows without slowing the sheet down with thousands of formulas.
- Save the comparison formulas sheet separately and delete it afterwards to keep file size down.
Troubleshooting
- Formula returns #REF! or #NAME? One of the referenced files is closed or renamed. Reopen both workbooks or update the file name in the formula.
- Compare Files is missing from the ribbon. Confirm you are on Windows with a qualifying Microsoft 365 plan, then check File > Options > Add-ins for the Inquire add-in. If it is not listed, use Method 1 or 3 instead.
- Everything shows as different. You are almost certainly comparing different ranges or sheets. Verify the sheet names and that both ranges start at the same cell.
- Numbers that look equal show FALSE. One value is probably stored as text, or there are hidden decimal places. Use
=ISNUMBER()to check, or round both sides with ROUND before comparing. - Excel is slow after filling formulas. Large grids of volatile comparisons can lag. Switch to Power Query or compare in smaller sections, and set calculation to Manual (Formulas > Calculation Options) while filling.
Frequently Asked Questions
Can I compare two Excel files without opening both?
Formulas can read from closed workbooks, but the references are fiddly to type. In practice it is far easier to open both files while building the comparison, then close the source file if you like.
Is there a free way to compare Excel files online?
Some web-based tools compare spreadsheets, but avoid uploading confidential data to third-party sites. The formula and conditional formatting methods above are free, private, and built into Excel.
Does Excel for Mac have the Compare Files tool?
No, the Inquire-based Compare Files feature is Windows-only. On Mac, use the formula or conditional formatting methods, which work identically.
How do I compare two versions of the same sheet within one file?
Use the same formula approach but reference the two sheets inside one workbook, for example =Sheet1!A1=Sheet2!A1. No file names are needed.
Can I see who made each change?
Not with these methods. To track authors, use Excel's Track Changes / Show Changes feature or the version history in OneDrive or SharePoint, which lists who edited each version.