Combination

Invoices missing from the ledger with FILTER, ISNA and XMATCH

List the invoices on the receivables specification that are not in the general ledger: XMATCH looks each one up, ISNA turns every miss into TRUE, and FILTER keeps those rows, with a message when nothing is missing.

Functions used:FILTERISNAXMATCHExcel 2021 or later (This combination needs Excel 2021 or later)

Difficulty rating 3 of 5

Worked example

Receivables invoices that are not in the ledger

Scenario

For the audit of Veldhuis Installatie BV you have the receivables specification at 30 September 2026 (columns A to C) and the list of sales invoice numbers you extracted from the general ledger XAF auditfile (column D).

You want to see which invoices on the specification have no posting in the ledger, together with customer and open amount, so you can ask the client for the underlying documents.

The data

Sheet excerpt: G2 holds the formula
RowABCDEFGHIJ
1Invoice (spec.)CustomerOpen amountInvoice (ledger)
225-0412Hofman Techniek BV€4,250.00€ 4.250,0025-041225-0420=FILTER(A2:C8, ISNA(XMATCH(A2:A8, D2:D8)), "Nothing missing")=FILTER(A2:C8; ISNA(XMATCH(A2:A8; D2:D8)); "Nothing missing")Jansen Logistiek BV€12,600.00€ 12.600,00
325-0415De Bruin Metaal BV€1,800.00€ 1.800,0025-041525-0441Van Dijk Transport BV€980.00€ 980,00
425-0420Jansen Logistiek BV€12,600.00€ 12.600,0025-0433
525-0433Kuiper Bouw BV€3,375.00€ 3.375,0025-0447
625-0441Van Dijk Transport BV€980.00€ 980,0025-0452
725-0447Smit Verpakking BV€7,200.00€ 7.200,0025-0460
825-0452Mulder Groep BV€2,150.00€ 2.150,0025-0461
9
Formula cell (G2)Spilled result

Formula in G2

=FILTER(A2:C8, ISNA(XMATCH(A2:A8, D2:D8)), "Nothing missing")
=FILTER(A2:C8; ISNA(XMATCH(A2:A8; D2:D8)); "Nothing missing")

Result: 25-0420 | Jansen Logistiek BV | €12,600.00 / 25-0441 | Van Dijk Transport BV | €980.0025-0420 | Jansen Logistiek BV | € 12.600,00 / 25-0441 | Van Dijk Transport BV | € 980,00

How the pieces fit together

Watch out: This only finds invoices that are on the specification but not in the ledger. An invoice that is in the ledger but not on the specification (here 25-0460 and 25-0461) stays hidden. For completeness, swap the two ranges and run the formula a second time.

The formula taken apart, from the inside out. Each part can be typed into its own cell to see what it returns.

  1. =XMATCH(A2:A8, D2:D8)
    =XMATCH(A2:A8; D2:D8)

    Looks up each of the seven invoice numbers of the specification in the ledger list. The result is one column: 1, 2, #N/A, 3, #N/A, 4, 5. The #N/A values are the invoices 25-0420 and 25-0441, which the ledger does not contain.

  2. =ISNA(XMATCH(A2:A8, D2:D8))
    =ISNA(XMATCH(A2:A8; D2:D8))

    ISNA turns the positions into TRUE for every #N/A and FALSE for every position: FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE. This is the include list for FILTER.

  3. =FILTER(A2:C8, ISNA(XMATCH(A2:A8, D2:D8)))
    =FILTER(A2:C8; ISNA(XMATCH(A2:A8; D2:D8)))

    FILTER keeps the rows of the specification where the include list is TRUE: rows 3 and 5. You get two rows of three columns: 25-0420 Jansen Logistiek 12,600 and 25-0441 Van Dijk Transport 980. If no row were TRUE, this version would show #CALC!.

  4. =FILTER(A2:C8, ISNA(XMATCH(A2:A8, D2:D8)), "Nothing missing")
    =FILTER(A2:C8; ISNA(XMATCH(A2:A8; D2:D8)); "Nothing missing")

    The third argument of FILTER is the text to show when no row qualifies. Here two rows qualify, so the result is the same two rows, 12,600 + 980 = 13,580 in total. If the ledger held all seven invoices, the cell would show the message instead of an error.

Step by step

  1. XMATCH(A2:A8, D2:D8) looks up each specification invoice in the ledger list:

    • 25-0412 is at position 1
    • 25-0415 is at position 2
    • 25-0420 is not found (#N/A)
    • 25-0433 is at position 3
    • 25-0441 is not found (#N/A)
    • 25-0447 is at position 4
    • 25-0452 is at position 5
  2. ISNA turns that into FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE: TRUE only for the two invoices that were not found.
  3. FILTER walks through A2:C8 with that list and keeps row 3 (25-0420, Jansen Logistiek BV, 12,60012.600) and row 5 (25-0441, Van Dijk Transport BV, 980).
  4. Two rows qualify, so the third argument (the message) is not used. The result spills over G2:I3. Together the two invoices are 12,60012.600 + 980 = 13,58013.580 of open receivables without a ledger posting.

Why it works

XMATCH returns a position for an invoice that exists and #N/A for one that does not, and ISNA turns exactly that difference into TRUE and FALSE.

FILTER needs one TRUE or FALSE per row of the specification, and XMATCH returns one answer for each value in A2:A8, whatever the length of the ledger list. The third argument takes care of the clean case where the ledger is complete.

Watch out for

  • Invoice numbers with a trailing space or typed as a number in one list and as text in the other do not match, so XMATCH reports them as missing even though they are there. Check the first few hits by hand before you send a request to the client.
  • The cells next to and below G2 must be empty. If something is in the way of the spill range, Excel shows #SPILL! instead of the list.

Variations

=FILTER(A2:C8, COUNTIF(D2:D8, A2:A8)=0, "Nothing missing")
=FILTER(A2:C8; COUNTIF(D2:D8; A2:A8)=0; "Nothing missing")

The older approach: COUNTIF counts how often each invoice occurs in the ledger list and FILTER keeps the zeros. Same two rows. It still needs FILTER, so it works in the same Excel versions.

=FILTER(A2:C8, ISNA(MATCH(A2:A8, D2:D8, 0)), "Nothing missing")
=FILTER(A2:C8; ISNA(MATCH(A2:A8; D2:D8; 0)); "Nothing missing")

MATCH with 0 as the third argument instead of XMATCH. The result is the same two rows; XMATCH is shorter because exact match is its default.

All combinations