New Tool Radar

AI for Data & Spreadsheets

How to Check Whether an AI-Written VLOOKUP Uses Approximate Match by Mistake

Check whether an AI-written VLOOKUP left out the exact-match argument, so it returns the wrong row on unsorted data.

Schematic with three steps: Read the fourth argument of the formula; Test it with a known lookup value; Add FALSE and re-test with two values.

VLOOKUP’s fourth argument defaults to approximate match (TRUE) when it is left out, and approximate match assumes the first column is sorted. On unsorted data such as product codes or names, it silently returns the closest smaller value instead of the exact row, which looks like a correct answer. Any AI-written VLOOKUP without FALSE as its last argument deserves a check.

What you need

  • The AI-written VLOOKUP formula
  • The lookup table, with its first column unsorted or sorted
  • One known lookup value and the answer it should return

Step 1: Read the fourth argument of the formula

Click the formula cell and look at the last argument. If it is TRUE, 1, or missing entirely, the formula uses approximate match; only FALSE or 0 gives an exact match.

Step 2: Test it with a known lookup value

Pick a value that is in the table and check the returned row against the source. If the formula returns a different row’s value, approximate match is the cause.

Step 3: Add FALSE and re-test with two values

Rewrite the formula with FALSE as the fourth argument and test it with the same value plus one more known value. Both must return the exact rows; a value that is genuinely absent should now return #N/A instead of a wrong row.

Worked example: synthetic price list in unsorted order

The table below is a synthetic example. It shows the expected result of checking an AI-written VLOOKUP; no formula was run.

Check Value Result
Lookup value tested P-118 Known product
Correct answer (price) 65 From the price column
AI formula fourth argument Missing Defaults to approximate
AI formula result 50 Wrong row returned
Corrected formula FALSE added Exact match
Corrected result 65 Matches the known price

Expected result (UNTESTED). the AI formula without a fourth argument returns 50, the value from a different row, because approximate match assumes sorted data; adding FALSE returns 65, the known price. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • Approximate match is correct for banded lookups such as tax rates, where the nearest smaller value is the intended answer; check the intent first.
  • Exact match needs the lookup value in the first column of the table; otherwise it returns #N/A.
  • A column index larger than the table width returns #REF!, which is a different fault from a wrong match.
  • Trailing spaces in the lookup column break exact matches even when the value looks identical.

Sources

See all