New Tool Radar

AI for Data & Spreadsheets

How to Check an AI Formula That Replaces VLOOKUP with XLOOKUP

Check an AI-written XLOOKUP replacement for VLOOKUP by testing it on known values and on a lookup that is missing.

Schematic illustration for How to Check an AI Formula That Replaces VLOOKUP with XLOOKUP: three numbered steps - Ask the AI for XLOOKUP; Test on a known SKU; Test on a missing SKU.

XLOOKUP looks in any direction and returns exact matches by default, which fixes the most common VLOOKUP trap of needing the lookup column on the left. An AI can rewrite a VLOOKUP as XLOOKUP, but the rewrite must be tested on a value that exists and on one that does not, or a silent wrong match can slip through.

Prerequisites

  • Excel with XLOOKUP (Microsoft 365, Excel 2021 or later)
  • A price list table with SKUs
  • A copy of the source file, so the original stays untouched.

Steps

  1. Ask the AI to rewrite the VLOOKUP as XLOOKUP, giving it the lookup cell, the SKU column and the price column.
  2. Read the returned formula and confirm the lookup array is the SKU column and the return array is the price column.
  3. Test it on a SKU whose price you know, and confirm the returned price matches the list.
  4. Test it on a SKU that is not in the list, and confirm it returns the not-found message instead of a wrong price.
  5. Copy the formula down the column and spot-check three more rows against the price list.

Worked example: Fictional hardware price lookup

The practice table below is a fictional five-item price list. The lookup column is the price returned for each SKU, and the total is the sum of the five prices. The table below is fictional practice material, with fictional values. It is the expected result, worked out by hand, not a run of any tool.

SKU Item Price
HW-101 Hammer 12.50
HW-102 Screwdriver set 18.75
HW-103 Tape measure 9.99
HW-104 Pliers 14.25
HW-105 Level 21.00
Total 76.49

Expected result. Five SKUs, each price matches the list, and the prices add to 76.49. UNTESTED: no AI formula was generated for this guide; the table shows the expected values a check should produce.

Limits

  • XLOOKUP is not available in Excel 2016 or Excel 2019, so a workbook shared with those versions will break.
  • An XLOOKUP without a not-found value returns an error on a missing lookup, so add the fourth argument.

Sources

See all