Compare Two Excel Exports and Catch Missing or Duplicate Rows
Use a shared ID to find what changed between two exports. If you’re checking whether a CSV loaded correctly, count and sum by line ID as well. A duplicate and a missing row can leave the grand total unchanged.
Start with a shared ID
Put the two exports in separate Excel tabs with names such as Previous and Current. Use a stable identifier such as an order ID, SKU, or project code. If there are multiple rows per ID, decide whether to compare at the line level or sum each export by ID first.
Ask for the changes
Try this in Jolene.pro
Match Previous and Current on Project ID. List new and removed projects separately. For matching projects, show the old and new Budget. Put blank and repeated IDs in a separate review list.
Verify a changed row
In a fictional project tracker with amounts in USD, P-103 moved from $1,200 in Previous!D4 to $1,500 in Current!D6. That’s an increase of $300. P-104 appears only in Current, so report it as new.
Check leading zeros, date formats, and how the exports define the reporting period. When you run the comparison again, confirm which tabs are the baseline and the current version.
Check a CSV refresh even when the totals agree
For a refresh check, compare the source export and the loaded data for the same reporting window and filters. Their totals should agree, but two errors can cancel out. These synthetic examples each have three data rows totaling $100 USD.
Source
Line ID,Amount USD
A-01,40
A-02,40
A-03,20
Imported
Line ID,Amount USD
A-01,40
A-01,40
A-03,20
Count and sum by transaction line ID in Excel
Import each CSV into its own sheet, named Source and Imported. Keep line IDs as text and amounts as numbers. Flag blank IDs before comparing and use a consistent ID format. Excel’s COUNTIF and SUMIF treat upper- and lowercase as equivalent, so use an exact case-sensitive comparison if case distinguishes IDs in your source.
On a third sheet, list every distinct ID from both exports in column A, starting at A2. Use these four formulas in B2 through E2, then fill down. For longer exports use the actual ranges or Excel Tables.
B2 =COUNTIF(Source!$A$2:$A$4,A2)
C2 =COUNTIF(Imported!$A$2:$A$4,A2)
D2 =C2-B2
E2 =SUMIF(Imported!$A$2:$A$4,A2,Imported!$B$2:$B$4)-SUMIF(Source!$A$2:$A$4,A2,Source!$B$2:$B$4)
Filter for a nonzero value in D or E. A-01 appears once in Source and twice in Imported, adding $40 USD. A-02 appears once in Source and never in Imported, subtracting $40 USD. A-03 matches. Reopen the raw rows for A-01 and A-02 before correcting the import. If one ID can legitimately cover several records, compare using a finer key such as order ID plus line number.
Set up the same check for next month
In Power Query, group each export by Line ID, count rows and sum Amount USD. Merge the grouped tables with a full outer join so IDs missing on either side remain visible. Keep a flag for the absent side, then use zero for its count and amount when calculating differences. If the totals differ, start with the files and refresh steps in the Excel University CSV refresh walkthrough. Microsoft documents Group By and the full outer join.
For a one-off review, upload the workbook with both tabs to Jolene.pro. Ask it to compare counts and USD amounts by Line ID and point to the source rows for each difference. Keep the prompt with your checklist so you can ask the same question against next month’s workbook. Compare the returned rows with the original export before changing your workflow.
If both teams edit their own copy, bring the last agreed version. See how to separate one-sided edits from sync conflicts before replacing either value.