Compare data
How to Compare Two Excel Files With Different Numbers of Rows
Compare Excel files with different row counts by matching record IDs. Find added, missing and changed records without treating shifted rows as changes.
See what changed in your files
Checking current offer…
Compare your filesTo compare two Excel files with different numbers of rows, match records by a stable ID before comparing their fields. Do not assume row 20 in the first export represents row 20 in the second. Insertions, missing records and sorting can shift rows without changing the records themselves.
Why row-by-row comparison breaks
Suppose a new customer appears near the top of the later file. A formula comparing each cell to the cell at the same address in the earlier file can mark every row below it as different. That tells you the positions changed; it does not tell you which customers changed.
Sorting both files can help with visual inspection, but an ID absent from one side can still leave the remaining rows out of alignment. A longer export also does not prove that it contains every record in the shorter one. You need to check membership in both directions.
Choose a key that identifies the same record
Use Customer ID, Invoice ID or another identifier that means the same thing in both exports. A name can change or repeat, so it may be a poor key. If each SKU appears in several warehouses, use SKU plus Warehouse together. For invoices with several lines, an invoice number alone may not identify a unique line.
Check text-versus-number types, leading zeroes and optional space/case rules before interpreting unmatched IDs. Do not delete duplicate records just to force a unique key. Repeated or missing IDs need review, or a better key, before you can conclude which records changed.
Worked example: four earlier rows and five later rows
The earlier file contains C001 through C004. The later file is reordered: C003, C001, C005, C004, C006. C001’s amount changes, C002 is absent, and two customers appear. Match Customer ID and compare Amount.
| Customer ID | Earlier amount | Later amount | Result |
|---|---|---|---|
| C001 | 100 | 125 | Changed |
| C002 | 200 | Absent | Removed |
| C003 | 300 | 300 | Unchanged |
| C004 | 400 | 400 | Unchanged |
| C005 | Absent | 500 | Added |
| C006 | Absent | 600 | Added |
The result is 2 added, 1 removed, 1 changed and 2 unchanged, with no records needing review in this example. The net row increase is only one, but three records changed membership: two arrived and one is absent. Counting rows alone would hide that distinction.
Run the comparison and download a separate report
If the columns also changed, follow the different-columns and headers walkthrough to pair the IDs and fields before interpreting the row results.
Open Compare Files to compare selected XLSX or CSV tables in your browser.
- Choose the earlier export as First file and the later export as Second file. Select the relevant worksheet from each workbook if needed.
- Check the proposed record ID. Confirm the key on both sides, or use multiple key columns when the record requires them.
- Choose the fields that matter, such as Amount or Status. Review field mapping when headers differ; an added column is a separate issue from an added record.
- Inspect the comparison totals and Needs review groups. Use source coordinates to check differences against the selected tables.
- Download the XLSX report containing Summary, Records, Cell changes and Needs review. Keep the original exports alongside it.
The comparison uses stored typed values and saved formula results. It leaves the originals untouched, does not recalculate formulas, and does not audit formula text, macros or formatting. It compares the selected worksheet pair rather than automatically auditing every tab.
Reconcile both source totals
For the example above, every key is unique and there are no blank separator rows or uncertain records. The counts reconcile as follows:
- Earlier: 4 rows = 1 changed + 2 unchanged + 1 removed.
- Later: 5 rows = 1 changed + 2 unchanged + 2 added.
- Combined: 6 record groups, rather than either file’s individual row total.
In a real file, review groups can contain multiple physical rows, so a Needs review group count is not a substitute for the number of source rows needing review. Use the tool’s separate first-file and second-file reconciliation lines, including review rows and ignored blank separators. Do not force uncertain groups into the simple example equations.
If you only need to find missing IDs, use a presence check
In a working copy, place the two ID lists on separate sheets. With an earlier ID in A2, =COUNTIF(Later!$A$2:$A$1000,A2) checks whether it appears in the later sheet. Extend the range to cover the entire export. Zero means no match under COUNTIF’s rules; more than one means repetition. Reverse the check to find later-only IDs.
That formula does not tell you whether a matched record’s amount changed. COUNTIF also ignores text case and interprets wildcard characters, so test your ID format before relying on it. See the two-list comparison guide for the difference between presence checks and comparing matched fields.
Does Removed mean the source record was deleted?
It means the key is absent from the second table. Check export filters, dates, selected worksheets and key types before assigning a business explanation. Keep the comparison direction clear: reversing the files reverses added and removed. A changed amount also does not identify who changed it or why.
If an unavailable Excel command brought you here, the greyed-out comparison command guide separates Inquire from legacy Compare and Merge. On a Mac, use the Mac walkthrough for platform-specific alternatives.
See what changed in your files
Checking current offer…
Compare your files