GSTR 2B XLOOKUP formula in Excel for fast ITC matching

To reconcile your purchase register with GSTR-2B in Excel, use the XLOOKUP function with a composite key combining supplier GSTIN and invoice number. A single formula pulls the exact IGST, CGST, and SGST figures from your downloaded GSTR-2B sheet into your purchase register, highlighting missing invoices immediately. This ensures your input tax credit claims comply with Section 16(2)(aa) before you file Form GSTR-3B.

Monthly input tax credit reconciliation in Excel often breaks down when accountants rely on basic lookup functions. Standard invoice numbers like 042 or 105 appear repeatedly across different vendors, leading ordinary lookups to fetch amounts from the wrong supplier. Under statutory compliance mandates, claiming credit for an invoice absent from GSTR-2B risks scrutiny under Rule 88D and Form DRC-01C.

To avoid mismatches, you need a precise matching method. Under Section 16(2)(aa) of the CGST Act, credit is admissible only when the supplier furnishes invoice details in Form GSTR-1 and communicates them to the recipient in Form GSTR-2B. Building an automated XLOOKUP formula with clean composite keys solves this problem directly in your spreadsheet.

Building the composite lookup key

An invoice number alone is never unique in a multi-vendor purchase register. Two different suppliers can both issue an invoice numbered INV/001. A supplier GSTIN is unique to the vendor, but a single vendor issues dozens of invoices every quarter. To create an unambiguous match, you must combine both fields into a composite key.

Open the B2B sheet of your downloaded Form GSTR-2B Excel file and your internal purchase register. Create a helper column named Match Key at column A in both sheets:

=UPPER(TRIM(B2))&"|"&UPPER(TRIM(C2))

In this formula, cell B2 contains the 15-digit supplier GSTIN, and cell C2 contains the supplier invoice number. The TRIM function strips unexpected leading or trailing spaces, UPPER converts all text to uppercase, and the pipe character prevents accidental collisions between different combinations of text strings.

Common mistake: Comparing invoice numbers without stripping special characters or spaces. If your purchase register records an invoice as INV-104 and the vendor filed it in GSTR-1 as INV/104, an exact match lookup returns an error, causing you to omit valid credit from Table 4(A)(5) of Form GSTR-3B.

The standard XLOOKUP formula for GSTR-2B matching

Once you establish helper keys in both your purchase register and the GSTR-2B sheet, apply the basic XLOOKUP formula in your purchase register sheet. Assume your GSTR-2B B2B data is in a sheet named GSTR2B, where column A holds the composite key, column I holds the integrated tax amount, column J holds the central tax amount, and column K holds the state tax amount.

To fetch the integrated tax amount into column H of your purchase register row 2, write:

=XLOOKUP(A2, GSTR2B!$A$2:$A$5000, GSTR2B!$I$2:$I$5000, 0, 0)

The components of this formula function as follows:

  1. A2: The composite key of the purchase register record (for example, 27AAAAA0000A1Z5|INV-101).
  2. GSTR2B!$A$2:$A$5000: The lookup array containing composite keys generated in the GSTR-2B sheet.
  3. GSTR2B!$I$2:$I$5000: The return array containing integrated tax values from the portal download.
  4. 0: The default value returned if the invoice is not found in GSTR-2B, replacing the default #N/A error.
  5. 0: The exact match mode argument, ensuring Excel only returns values when the composite key matches perfectly.

Repeat the formula for central tax and state tax by pointing the return array to columns J and K respectively. When the returned tax figure is 0, the invoice is missing from the GSTR-2B download, meaning it is not yet eligible for credit under Rule 36(4).

Handling partial matches and formatting discrepancies

In practical accounting work, vendors frequently omit forward slashes, drop financial year suffixes like /26-27, or truncate invoice numbers when uploading to the GST portal. When exact matching leaves unpaid credits unverified, you can configure XLOOKUP with wildcard searches.

Excel allows wildcard searches using asterisks (*) when match mode is set to 2. To search for an invoice number embedded within an irregular string, combine the supplier GSTIN with a wildcard pattern:

=XLOOKUP(B2&"|*"&C2&"*", GSTR2B!$A$2:$A$5000, GSTR2B!$I$2:$I$5000, 0, 2)

For more resilient matching without helper columns, clean the invoice numbers by removing punctuation directly in the lookup logic using the SUBSTITUTE function:

=XLOOKUP(B2&"|"&SUBSTITUTE(SUBSTITUTE(C2,"/",""),"-",""), GSTR2B_CleanKeys, GSTR2B_Tax, 0, 0)

This removes slashes and hyphens before executing the comparison, bridging differences between accounting software entries and portal uploads.

Two-way XLOOKUP return: You can pull multiple columns simultaneously. Passing GSTR2B!$I$2:$K$5000 as the return array allows a single XLOOKUP formula to spill integrated tax, central tax, and state tax across three adjacent columns in modern versions of Excel.

Worked example: purchase register versus GSTR-2B

Consider a registered manufacturing business in Maharashtra reconciling inward supplies for the tax period. The purchase register contains three supplier invoices. The accountant runs XLOOKUP against the downloaded GSTR-2B B2B table to determine eligible input tax credit.

Supplier GSTIN Invoice Books Tax GSTR-2B XLOOKUP Result Tax Difference Filing Action
27AAAAA0000A1Z5 INV-101 ₹18,000 ₹18,000 ₹0 Claim in Table 4(A)(5)
27BBBBB1111B1Z2 084 ₹27,000 ₹0 (Not in 2B) ₹27,000 Defer credit; notify vendor
27CCCCC2222C1Z9 INV/2026/55 ₹9,000 ₹9,000 ₹0 Claim in Table 4(A)(5)

Calculation summary for Form GSTR-3B:

  1. Total tax in purchase register: ₹18,000 + ₹27,000 + ₹9,000 = ₹54,000.
  2. Eligible tax found in GSTR-2B via XLOOKUP: ₹18,000 + ₹0 + ₹9,000 = ₹27,000.
  3. Unmatched tax held in abeyance: ₹54,000 - ₹27,000 = ₹27,000.

Claiming ₹54,000 in Table 4(A)(5) would create an excess credit claim of ₹27,000 over Form GSTR-2B, exposing the taxpayer to automated notices under Rule 88D. By restricting the claim to ₹27,000, the business stays fully compliant with statutory rules. For broader reconciliation workflows, read our GSTR-2B reconciliation and ITC matching guide.

Export Purchase Register → Generate Composite Keys → Run XLOOKUP → Verify Tax Variances → Claim Eligible ITC

Frequently asked questions

Why does a normal VLOOKUP fail on invoice numbers in GSTR-2B?

Invoice numbers frequently repeat across different vendors, leading VLOOKUP to pull the first match it encounters. In addition, VLOOKUP requires the lookup column to sit to the left of the return column, whereas XLOOKUP can search any column and pairs naturally with composite keys combining GSTIN and invoice number.

How do you handle leading zeros and prefix differences in invoice numbers?

Suppliers often enter invoice numbers in GSTR-1 without leading zeros or without financial year prefixes. Clean the invoice strings in both sheets using UPPER, TRIM, and SUBSTITUTE to strip punctuation like slashes, or use XLOOKUP with wildcard matching by passing 2 as the match mode argument.

Can you claim ITC if an invoice appears in books but XLOOKUP returns Not in 2B?

Under Section 16(2)(aa) of the CGST Act and Rule 36(4), input tax credit can only be availed if the invoice details have been furnished by the supplier in GSTR-1 and communicated to the recipient in Form GSTR-2B. If an invoice is absent from GSTR-2B, the credit cannot be availed in GSTR-3B for that tax period.

Reconcile GSTR-2B in seconds without complex formulas

If managing helper columns and spreadsheet formulas takes too much time, try our free matching tool. Your GSTR-2B and purchase register files are read in your browser and never uploaded to any server.

Reconcile GSTR-2B →

Last checked: 1 November 2026. Sources: CBIC Central Tax Section 16 Repository, GSTN Form GSTR-2B Manual.