Skip to main content
How-To · 7 min read

How to Compare Two Excel Files With Power Query Merge (No Formulas Needed)

Load both files into Power Query, merge them on a shared key such as the UTR or invoice number, and expand the result. Rows found in only one file are the unmatched items, and Refresh re-runs the whole match on next month's files.

Terra Insight
Terra Insight Editorial Team Reconciliation Infrastructure

Content authored by practitioners with experience at Amazon India, Intuit QuickBooks, and the Tata Group. Meet the team →

Published 14 October 2026
Domain expertise
TDS Reconciliation GST Input Credit Platform Settlements NACH Batch Matching Bank Reconciliation Form 26AS Matching ERP Integrations Enterprise Finance Ops
Knowledge Card
Problem

Comparing a bank extract with the books by formula every month is slow and breaks when files change size.

How It's Resolved

Load both files as Power Query queries, clean and type the key column, then merge with inner, left anti and right anti joins to produce matched, bank-only and books-only lists that refresh with new files.

Configuration

Two source files with a shared key such as the UTR, three merge queries loaded to separate sheets, and a fixed file location for next month's exports.

Output

Three refreshable lists: matched rows, bank lines not in the books, and book lines not in the bank, with counts that add back to each file's total.

Load both files into Power Query. Merge them on a shared key such as the UTR or invoice number. Expand the result. Rows found in only one file are your unmatched items. Next month, drop in the new files and click Refresh; the whole match runs again with no formulas to copy down.

Power Query is built into Excel 2016 and later, including Microsoft 365, under Data, Get and Transform Data.

Which merge type answers which question?

Join kind in Power QueryWhat it keepsQuestion it answers
InnerRows with the key in both filesWhich lines matched?
Left antiRows in the first file with no match in the secondWhat is in the bank but not in the books?
Right antiRows in the second file with no match in the firstWhat is in the books but not in the bank?
Full outerEvery row from both, matched where possibleShow me everything in one table
Left outerEvery row from the first, with matches from the secondAdd book details next to every bank line

For a reconciliation you usually build three queries: inner, left anti and right anti.

How do I set it up, step by step?

  1. Load the bank extract. Data, Get Data, From File, From Workbook (or From Text/CSV). Pick the sheet and click Transform Data, not Load.
  2. Clean the key. Select the UTR column. Set the type to Text (Transform, Data Type, Text). Then Transform, Format, Trim, and Format, Uppercase.
  3. Close and load as connection only. Home, Close and Load To, choose Only Create Connection. Name the query “Bank”.
  4. Repeat for the books (a Tally day book or bank ledger export). Clean its key the same way. Name it “Books”.
  5. Merge. Data, Get Data, Combine Queries, Merge. Choose Bank on top, Books below, click the UTR column in each, and pick Join Kind: Inner. Click OK.
  6. Expand. In the new query, click the expand icon on the Books column and tick the amount and date fields you want.
  7. Repeat the merge with Left Anti and Right Anti for the two unmatched lists.
  8. Load each result to its own sheet: Matched, Bank only, Books only.

Each step is recorded in the Applied Steps pane on the right. That record is what makes it repeatable.

Worked example: 1,250 bank lines against 1,198 book lines

A finance executive merges September’s current account extract (1,250 lines) with the bank ledger from Tally (1,198 lines) on UTR.

QueryRows
Inner (matched)1,190
Left anti (bank only)60
Right anti (books only)8

Check: 1,190 matched plus 60 bank-only is 1,250, the full bank file. 1,190 plus 8 books-only is 1,198, the full books file. If those totals do not add back, some keys appear more than once.

The 60 bank-only lines include bank charges of ₹5,900 across 22 lines, three customer receipts worth ₹2,84,000 not yet entered in Tally, and NACH debits for an EMI of ₹46,250. The 8 books-only lines are cheques of ₹3,12,400 issued but not yet presented. Each list goes to the person who can explain it.

Why do keys fail to match, and how do I clean them inside Power Query?

CauseSymptomFix in Power Query
Text versus numberMerge shows no matches at all, or the preview says few rows matchSet both key columns to Text before merging
Leading or trailing spacesSome obvious pairs missTransform, Format, Trim
Capital letters”hdfc” does not match “HDFC”Transform, Format, Uppercase; the standard merge is case-sensitive
UTR buried in the narrationNo UTR column in the bank fileAdd Column, Extract, Text Between Delimiters, or Split Column by delimiter
Hidden charactersPairs still miss after TrimTransform, Format, Clean

Do the cleaning in the Bank and Books queries, before the merge, so every merge uses the clean key.

When is Power Query enough, and when is it not?

Power Query is enough when:

  • One clean key, such as the UTR, exists on both sides.
  • Each key appears once in each file.
  • Amounts are expected to match exactly.

It starts to struggle when:

  • Amounts differ slightly. A merge needs an exact key. Matching ₹48,500.00 against ₹48,499.60 within a ₹1 tolerance needs a formula step afterwards.
  • One payment settles many invoices. A ₹2,36,000 receipt against two invoices of ₹1,18,000 will not merge on invoice number.
  • References are typed differently. Microsoft 365 offers fuzzy matching in the merge dialog, which compares text similarity. It helps with names, but it can pair the wrong references, so check every fuzzy match.

Next, read Excel versus Python versus reconciliation software, which covers when a refreshable query stops being enough, and when manual reconciliation tops out. If you prefer formulas, see VLOOKUP, XLOOKUP or INDEX-MATCH.

TransactIG matches bank statement lines to your books and keeps what is left in an exception queue; see bank reconciliation software for India.

Primary reference: Reserve Bank of India — which runs the NEFT and RTGS systems; the unique transaction reference (UTR) on each transfer is the most reliable shared key between a bank extract and the books..

Frequently Asked Questions

Which Excel versions have Power Query?
Power Query is built into Excel 2016 and later, including Microsoft 365, under Data, Get and Transform Data. Excel 2010 and 2013 for Windows could add it as a free add-in.
What is a left anti join?
It keeps only the rows from the first table that have no match in the second. With the bank extract as the first table, it lists bank lines missing from the books.
Why does my merge find no matches?
The key columns have different data types, such as number in one file and text in the other, or differ in spaces or capital letters. Set both to Text, then Trim and Uppercase them.
Do I have to redo the merge every month?
No. Replace the source files with next month's files, keeping the same names and columns, and click Refresh All. Power Query replays every step.
Can Power Query match amounts within a tolerance?
Not in a standard merge, which needs exact key matches. Fuzzy matching in Microsoft 365 compares text similarity, not amounts within ₹1, so tolerance matching still needs a formula or another tool.

See how TransactIG handles reconciliation for your industry

Configuration takes 2–4 weeks. No code development required. ISO 27001:2022 certified.