Back to all formula guides
6 min read••Gridverse Team

XLOOKUP vs VLOOKUP: 7 Copy-Paste Examples for Excel

Stop broken VLOOKUP reports after inserting columns. Copy 7 working XLOOKUP examples for left lookups, two criteria, and clean #N/A fallbacks today.

inventory_lookup.xlsx
D2fx
#A · ItemB · PriceC · SearchD · Result
2Espresso$4.00Espresso—
3Americano$3.50——
4Matcha$5.25——
5Cold Brew$4.50——
Typing formula in D2...Gridverse Excel Engine

Inserting one column inside a pricing table turns an entire VLOOKUP workbook into wrong numbers or #REF! overnight. That happens because VLOOKUP relies on a hard-coded column number (col_index_num), whereas XLOOKUP links directly to the return column you select. If you are preparing for hiring tests or maintaining older workbooks that require traditional formulas, consult our step-by-step guide on how to use VLOOKUP in Excel.

Instead of reading dry theory, use the sample sheet below to copy seven working XLOOKUP patterns straight into Microsoft Excel or Google Sheets.

Sample Dataset Used in These Examples

Assume you manage an inventory table in A2:D6 with SKU codes, product names, categories, and unit prices:

Row Col A (SKU) Col B (Item) Col C (Category) Col D (Price)
2 SKU-101 Espresso Coffee $4.00
3 SKU-102 Americano Coffee $3.50
4 SKU-103 Matcha Tea $5.25
5 SKU-104 Croissant Bakery $3.80
6 SKU-105 Cold Brew Coffee $4.50

Visual Syntax Breakdown: XLOOKUP vs VLOOKUP

Here is the core syntax you need beside your keyboard:

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
  • lookup_value: What you are searching for (for example, "Espresso" or cell F2).
  • lookup_array: Single column or row where Excel looks for that value (B2:B6).
  • return_array: Column or row containing the result (D2:D6).
  • [if_not_found]: Optional clean fallback text or 0 instead of #N/A.
  • [match_mode]: 0 for exact match (default—no more forgetting FALSE!).
  • [search_mode]: 1 top-to-bottom, -1 bottom-to-top to grab the latest entry.
XLOOKUP syntax anatomy showing lookup_value, lookup_array, return_array, and if_not_found
Practice assembling XLOOKUP arguments block by block inside the Gridverse LEGO Formula Builder.

7 Copy-Paste XLOOKUP Examples for Real Workbooks

1. Basic Exact Match (No FALSE Required)

Problem: Look up the price of "Espresso" typed in cell F2 without counting column numbers.

=XLOOKUP(F2, B2:B6, D2:D6)

With VLOOKUP, you had to write =VLOOKUP(F2, B2:D6, 3, FALSE). If someone inserts a Supplier column between C and D, VLOOKUP silently returns the wrong column while XLOOKUP adjusts D2:D6 automatically.

2. Left Lookup Without Moving Columns

Problem: You have the product name "Matcha" in F2 (Col B) and need its SKU from Col A.

=XLOOKUP(F2, B2:B6, A2:A6)

VLOOKUP cannot look left unless you restructure the table or nest CHOOSE. XLOOKUP decouples lookup_array (B2:B6) from return_array (A2:A6), so column order never blocks your report.

3. Built-In #N/A Fallback Without Wrapping IFERROR

Problem: New SKUs in an import file trigger #N/A across your summary dashboard.

=XLOOKUP(F2, A2:A6, D2:D6, "Missing SKU")

For numeric totals where text would break a downstream =SUM() formula, return 0 instead:

=XLOOKUP(F2, A2:A6, D2:D6, 0)

Want to diagnose why other lookup formulas still throw errors? See our guide to fixing #N/A errors in Excel or our guide to fixing #REF! errors in Excel.

4. Return Multiple Columns With One Formula

Problem: Pull both Category (Col C) and Price (Col D) for a single SKU in F2.

=XLOOKUP(F2, A2:A6, C2:D6, "Not found")

Because C2:D6 spans two columns, Excel and Google Sheets spill Coffee and $4.00 into adjacent cells automatically—no duplicate lookup formulas needed. Note: if a nearby cell is occupied, Excel shows #SPILL!, so leave the right cell blank (see our guide on how to fix the #SPILL! error in Excel). When you need to extract multiple matching rows simultaneously across an entire table, explore our comprehensive guide on the FILTER function in Excel with multiple criteria.

5. Two-Criteria Lookup (Item + Category)

Problem: Match both Item (F2) and Category (G2) in a table where item names repeat across categories.

=XLOOKUP(F2 & "|" & G2, B2:B6 & "|" & C2:C6, D2:D6, 0)

The "|" delimiter prevents accidental collisions (for example, "AB" & "C" vs "A" & "BC"). Every analyst who faces an Excel job assessment gets tested on multi-criteria lookups sooner or later. For advanced boolean array evaluation without concatenation, explore our complete guide to XLOOKUP with multiple criteria.

6. Find the Latest Entry Using Reverse Search

Problem: A daily price log appends new rows at the bottom, and VLOOKUP always grabs the oldest match at the top.

=XLOOKUP(F2, B2:B500, D2:D500, "No history", 0, -1)

Setting search_mode to -1 scans bottom-to-top and returns the most recent price immediately.

7. Approximate Match for Tax or Commission Tiers

Problem: Look up a discount tier in F2 against minimum spend thresholds in A2:A6 (0, 100, 500, 1000) and return the rate in B2:B6.

=XLOOKUP(F2, A2:A6, B2:B6, 0, -1)

Setting match_mode to -1 finds an exact match or the next smaller item, even when your tier table isn’t sorted the old VLOOKUP(..., TRUE) way.

Formula Comparison Table: XLOOKUP vs VLOOKUP vs INDEX/MATCH

Feature XLOOKUP VLOOKUP INDEX / MATCH
Default match mode Exact (0) Approximate (TRUE) Requires 0 in MATCH
Lookup direction Left, right, up, down Right only Left, right, up, down
Safe when inserting columns Yes No (breaks col_index_num) Yes
Built-in #N/A fallback Yes ([if_not_found]) No (needs IFNA/IFERROR) No (needs IFNA/IFERROR)
Bottom-to-top search Yes (search_mode = -1) No Requires workarounds
Excel 2016 / older compatibility Microsoft 365, 2021+, Sheets All versions All versions

If you share files with colleagues running Excel 2016 or earlier, pair INDEX and MATCH as shown in our INDEX MATCH in Excel guide with 7 practical examples and our guide to fixing #REF! errors in Excel so your formulas stay portable without breaking when columns move. For searches requiring substring pattern matching, explore our XLOOKUP wildcard guide for partial matching to handle flexible text queries cleanly.

Practice XLOOKUP in 5 Minutes With Gridverse

Reading syntax once fades quickly when a hiring test timer is ticking. On Gridverse, you can assemble =XLOOKUP("Espresso", A2:A5, B2:B5) like LEGO blocks with real-time feedback from Celdi, then drill edge cases in 5-minute sessions beside your keyboard.

Frequently Asked Questions (FAQ)

Does XLOOKUP work in Google Sheets as well as Excel?

Yes. Google Sheets added full native support for XLOOKUP, including [if_not_found], [match_mode], and [search_mode]. Formulas copied between Microsoft 365 and Google Sheets work identically.

Why did my XLOOKUP return #VALUE! on a two-criteria lookup?

#VALUE! appears when lookup_array and return_array have different row counts, such as B2:B6 paired with D2:D10. Make sure every array in the formula starts and ends on the exact same row numbers. For complete troubleshooting of data type and dimension errors, see our guide to fixing #VALUE! errors in Excel.

Should I still learn VLOOKUP for job interviews?

Yes, for reading legacy workbooks, because older company templates still contain VLOOKUP. However, knowing XLOOKUP and INDEX/MATCH lets you answer modern assessment tasks faster without fragile column index numbers. If typos like =XLOOKP or missing quotes generate errors on your test, see our guide to fixing #NAME? errors in Excel.

What is the Spanish or localized equivalent of XLOOKUP?

In Spanish Excel it is BUSCARX, in French RECHERCHEX, in German XVERWEIS, and in Portuguese PROCX, using semicolons (;) instead of commas between arguments. You can check the localized examples in our Spanish BUSCARX guide.