Key points
- A VLOOKUP typed without its fourth argument runs an approximate match that expects a sorted first column, so a missing ID can return another row’s value instead of #N/A; add FALSE (or 0) for an exact match. XLOOKUP is exact by default.
- XLOOKUP takes separate search and return ranges, so it can return a column to the left of the search column, keeps pointing at the right data when a column is inserted, and can return several columns from one formula.
- XLOOKUP is available in Excel for Microsoft 365, Excel 2021, Excel 2024, Excel for the web and the mobile apps; Microsoft’s XLOOKUP page states it is not available in Excel 2016 or Excel 2019, where Microsoft says such a formula shows #NAME? when calculated.
- Microsoft publishes no XLOOKUP-vs-VLOOKUP timing; its performance guidance says exact-match lookup time grows with the cells scanned, so time both versions on your own file before switching for speed.
- For two conditions, XLOOKUP can search a calculated array such as (A2:A7=F2)*(B2:B7=G2) with no helper column; in Excel 2016 or 2019 use INDEX and MATCH with a helper column, or as an array formula entered with Ctrl+Shift+Enter.
XLOOKUP vs VLOOKUP comes down to how each one finds the answer. VLOOKUP searches the first column of a table and returns a column you pick by number, and if you leave out its last argument it runs an approximate match. XLOOKUP takes a separate search range and return range, so it can look left, and it returns an exact match unless you ask for something else. The catch is version support: Microsoft says XLOOKUP is not available in Excel 2016 or Excel 2019, so a shared workbook can break for colleagues still on those versions.
Below is each difference side by side, a small training-record table you can rebuild to test every formula, a conversion cheat sheet, and the cases where VLOOKUP is still the safer choice.
XLOOKUP vs VLOOKUP: the key differences
Both functions return a value from the row where a match is found. The rows below follow Microsoft’s XLOOKUP, VLOOKUP and INDEX function pages.
| Feature | VLOOKUP | XLOOKUP | INDEX/MATCH |
|---|---|---|---|
| How it finds the return column | A column number (col_index_num) counted from the left edge of table_array | A separate return_array range | INDEX returns from a range; MATCH supplies the row position |
| Default match type | Approximate (range_lookup TRUE) when the fourth argument is left out; the first column must be sorted | Exact match (match_mode 0) | MATCH defaults to match_type 1 (approximate, ascending order); use 0 for exact |
| Look up to the left | Not directly: the lookup value must be in the first column of table_array | Yes | Yes |
| A column is inserted inside the table | The typed column number does not change, so the formula can return the wrong column | The ranges shift with the data | The ranges shift with the data |
| Value not found | #N/A; wrap in IFNA or IFERROR to show text | Built-in if_not_found argument | #N/A; wrap in IFNA or IFERROR |
| Return several columns | One formula per column | One formula; the result spills into neighboring cells | INDEX with column_num 0 returns the whole row as an array (entered with Ctrl+Shift+Enter over the output range in Excel 2016 or 2019) |
| Search last to first | No; it returns the first match | Yes, search_mode -1 | Not with MATCH; XMATCH has search_mode -1 (Microsoft 365, 2021, 2024 and web; not 2016 or 2019) |
| Wildcards (* and ?) | Yes, in exact-match mode with a text lookup value | Only with match_mode 2 | Yes, with match_type 0 |
| Excel versions | Microsoft 365, 2024, 2021, 2019, 2016, web | Microsoft 365, 2024, 2021, web and mobile apps; not 2019 or 2016 | Microsoft 365, 2024, 2021, 2019, 2016, web |
Watch the default match type. A VLOOKUP typed with three arguments is an approximate match. On an unsorted list, or when the value is missing, it can return another row’s value instead of an error. The worked example below shows this with a missing employee ID.
XLOOKUP syntax explained
Microsoft gives the syntax as:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Compare it with =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]). VLOOKUP needs the whole table and a column count; XLOOKUP needs only the column you search and the column you want back.
Required arguments
- lookup_value: the value to search for, usually a cell such as an employee ID.
- lookup_array: the single column (or row) to search.
- return_array: the column, or block of columns, to return from. Keep it the same height as lookup_array for a vertical lookup.
Optional if_not_found, match_mode and search_mode
| Argument | Value | What it does (Microsoft’s description) |
|---|---|---|
| if_not_found | Any text, number or formula | Returned when no valid match is found; if it is left out, #N/A is returned |
| match_mode | 0 (default) | Exact match; #N/A if none is found |
| match_mode | -1 | Exact match, or the next smaller item |
| match_mode | 1 | Exact match, or the next larger item |
| match_mode | 2 | Wildcard match, where *, ? and ~ have special meaning |
| search_mode | 1 (default) | Search from the first item |
| search_mode | -1 | Reverse search from the last item |
| search_mode | 2 or -2 | Binary search on data sorted ascending (2) or descending (-2); unsorted data gives invalid results |
Because if_not_found comes before match_mode, a formula that sets a match mode also has to fill or skip the fourth argument. The formulas in this guide fill it with text, which makes the result easier to read.
XLOOKUP example with sample data you can rebuild
Type this table into a blank sheet starting at cell A1 (headers in row 1), then put E-103 in cell H2 and E-109 in cell H3. E-109 is deliberately missing from the list. Every result below was worked out from these rows.
| Name (A) | Employee ID (B) | Department (C) | Course (D) | Hours (E) |
|---|---|---|---|---|
| Ana Ruiz | E-101 | Payroll | BSA/AML | 2 |
| Ben Cole | E-102 | HR | Harassment prevention | 1 |
| Cara Diaz | E-103 | Finance | BSA/AML | 2 |
| Dev Patel | E-104 | HR | HIPAA basics | 1.5 |
| Eli Moss | E-105 | Payroll | HIPAA basics | 1.5 |
Exact-match employee lookup
To return the department for the ID in H2, VLOOKUP needs a table that starts at the ID column (B) and the column number of Department within it (2):
=VLOOKUP(H2,B2:E6,2,FALSE) returns Finance.
XLOOKUP names the two columns directly:
=XLOOKUP(H2,B2:B6,C2:C6) returns Finance.
Now insert a new column between B and C. The VLOOKUP table becomes B2:F6 but the 2 stays 2, so the formula returns whatever is in the new column. The XLOOKUP becomes =XLOOKUP(H2,B2:B6,D2:D6) on its own and still returns Finance.
Looking up to the left
The name sits in column A, to the left of the ID. VLOOKUP cannot return it from this layout because the lookup value must be in the first column of table_array. XLOOKUP can:
=XLOOKUP(H2,B2:B6,A2:A6) returns Cara Diaz.
In Excel 2016 or 2019 the same result comes from =INDEX(A2:A6,MATCH(H2,B2:B6,0)).
Returning “Not found” instead of #N/A
=VLOOKUP(H3,B2:E6,2,FALSE) returns #N/A, because E-109 is not in the list. To show text instead, VLOOKUP needs a wrapper:
=IFNA(VLOOKUP(H3,B2:E6,2,FALSE),"Not found") returns Not found.
XLOOKUP has the argument built in:
=XLOOKUP(H3,B2:B6,C2:C6,"Not found") returns Not found.
IFNA reacts only to #N/A. IFERROR, which many older workbooks use, also hides other errors, such as a broken reference, so a real problem can look like a missing record.
The missing-ID trap in VLOOKUP’s default
Leave out the fourth argument and VLOOKUP runs an approximate match:
=VLOOKUP(H3,B2:E6,2) returns Payroll.
That is Eli Moss’s department. The IDs are sorted, and an approximate match returns the largest value that is less than or equal to the lookup value, which is E-105. A report built this way would show a training record for an employee who is not on the list. The XLOOKUP equivalent, =XLOOKUP(H3,B2:B6,C2:C6), returns #N/A because exact match is its default.
Returning several columns at once
=XLOOKUP(H2,B2:B6,C2:E6) returns Finance, BSA/AML and 2 in three cells side by side. Microsoft calls this spilling: the cells to the right must be empty, or Excel shows a #SPILL! error, and spilled formulas don’t work inside an Excel table, so put the formula in the grid beside the table.
How to use XLOOKUP instead of VLOOKUP
Converting a VLOOKUP is mechanical once you know which column of table_array it returns. Work through these steps for each formula you change:
- Confirm that everyone who opens the workbook has XLOOKUP (Excel for Microsoft 365, Excel 2021, Excel 2024 or Excel for the web).
- Check the fourth argument of the VLOOKUP: FALSE or 0 means exact match; TRUE, 1 or no fourth argument at all means approximate match.
- Keep lookup_value as it is.
- Set lookup_array to the first column of the old table_array (B2:B6 for B2:E6).
- Set return_array to the column at col_index_num, counting the first column of table_array as 1 (column 2 of B2:E6 is C2:C6).
- For an approximate match, set match_mode to -1; for a lookup that uses * or ?, set match_mode to 2.
- Replace an IFNA or IFERROR wrapper with the if_not_found argument.
- Add $ signs (B$2:B$6, C$2:C$6) before filling the formula down.
- Compare a sample of old and new results before you delete the old formulas.
Conversion cheat sheet: VLOOKUP pattern to XLOOKUP pattern
Results use the sample table above, with E-103 in H2 and E-109 in H3.
| Task | VLOOKUP or older pattern | XLOOKUP pattern | Result |
|---|---|---|---|
| Exact match | =VLOOKUP(H2,B2:E6,2,FALSE) | =XLOOKUP(H2,B2:B6,C2:C6) | Finance |
| Text when not found | =IFNA(VLOOKUP(H3,B2:E6,2,FALSE),"Not found") | =XLOOKUP(H3,B2:B6,C2:C6,"Not found") | Not found |
| Approximate match on sorted, unique IDs | =VLOOKUP(H2,B2:E6,2,TRUE) | =XLOOKUP(H2,B2:B6,C2:C6,"Not found",-1) | Finance |
| Return a column to the left | =INDEX(A2:A6,MATCH(H2,B2:B6,0)) | =XLOOKUP(H2,B2:B6,A2:A6) | Cara Diaz |
| Several columns | Three VLOOKUPs with column numbers 2, 3 and 4 | =XLOOKUP(H2,B2:B6,C2:E6) | Finance, BSA/AML, 2 |
| Wildcard | =VLOOKUP("E-10*",B2:E6,2,FALSE) | =XLOOKUP("E-10*",B2:B6,C2:C6,"Not found",2) | Payroll (first ID starting E-10) |
Check the wildcard row carefully when you convert. VLOOKUP treats * and ? as wildcards in exact-match mode, while XLOOKUP treats them as wildcards only in match_mode 2. Without the 2, the XLOOKUP looks for the literal text “E-10*” and returns Not found.
XLOOKUP with multiple criteria
A training log is a good example of a two-condition lookup: one employee, one course. Type this log on a second sheet starting at A1, then put E-101 in F2 and BSA/AML in G2. Employee E-101 took BSA/AML twice.
| Employee ID (A) | Course (B) | Score (C) |
|---|---|---|
| E-101 | BSA/AML | 78 |
| E-102 | HIPAA basics | 91 |
| E-101 | HIPAA basics | 88 |
| E-103 | BSA/AML | 84 |
| E-101 | BSA/AML | 95 |
| E-102 | BSA/AML | 80 |
XLOOKUP can search a calculated array, so no helper column is needed:
=XLOOKUP(1,(A2:A7=F2)*(B2:B7=G2),C2:C7) returns 78.
Each comparison gives TRUE or FALSE for every row; multiplying them gives 1 only where both conditions are true, and XLOOKUP looks for that 1. It returns the first match, row 2. To get the latest attempt in a log kept in date order, search from the bottom:
=XLOOKUP(1,(A2:A7=F2)*(B2:B7=G2),C2:C7,"No record",0,-1) returns 95.
Joining the keys also works: =XLOOKUP(F2&"|"&G2,A2:A7&"|"&B2:B7,C2:C7) returns 78. The | separator stops two different pairs from joining into the same text. To list every attempt rather than one, FILTER (same Excel versions as XLOOKUP) returns 78 and 95: =FILTER(C2:C7,(A2:A7=F2)*(B2:B7=G2)).
VLOOKUP has no multiple-criteria form. In Excel 2016 or 2019, add a helper column D with =A2&"|"&B2 filled down to D7, then use =INDEX(C2:C7,MATCH(F2&"|"&G2,D2:D7,0)), which returns 78. Without a helper column, =INDEX(C2:C7,MATCH(1,(A2:A7=F2)*(B2:B7=G2),0)) also returns 78, but in those versions it has to be entered with Ctrl+Shift+Enter. A VLOOKUP version works only if the helper column is the first column of table_array, which usually means inserting it to the left of the data. If you need counts per course rather than one value per row, a pivot table is the better tool; the guide to pivot table count unique values shows how.
Is XLOOKUP faster than VLOOKUP?
Microsoft publishes no timing comparison between XLOOKUP and VLOOKUP, so treat any blanket claim with caution. What Microsoft does document, in its Excel performance guidance on Microsoft Learn, explains where lookup time goes:
- With exact match, calculation time is proportional to the number of cells scanned before a match is found, so long ranges cost more.
- Approximate match on sorted data is fast and is not much affected by the length of the range; Microsoft says its characteristics are the same as binary search.
- In Office 365 version 1809 and later, exact-match VLOOKUP, HLOOKUP and MATCH on unsorted data became much faster when several columns are looked up from the same table range.
- VLOOKUP is about 5 percent faster than INDEX and MATCH, but one stored MATCH reused by several INDEX formulas can save more time than that.
- Keeping lookups and data on one sheet, and limiting ranges to the rows you need, speeds up exact-match lookups.
That guidance covers VLOOKUP, HLOOKUP and MATCH; it does not mention XLOOKUP. The XLOOKUP page describes search_mode 2 and -2 as binary searches that rely on sorted data and return invalid results if the data is not sorted, but gives no timing. For a large payroll or HR file, the practical answer is to test. Copy the workbook, fill one column with each version of the formula, set calculation to Manual and time a full recalculation with Ctrl+Alt+F9 on Windows.
XLOOKUP vs INDEX MATCH: should you still use it?
INDEX/MATCH did the jobs XLOOKUP was built for, years earlier: left lookups, separate return ranges and two-way lookups with a second MATCH for the column. XLOOKUP does the same in one function, with exact match as the default and a built-in not-found argument, and Microsoft’s XLOOKUP page shows a nested XLOOKUP doing the two-way lookup. Keep INDEX/MATCH when:
- The file goes to Excel 2016 or 2019 users. Microsoft lists INDEX and MATCH, like VLOOKUP, for Excel 2016 and 2019 as well as the newer versions.
- One match feeds many columns. Microsoft’s performance guidance suggests storing one MATCH result in a cell and reusing it in several INDEX formulas.
If you like the INDEX/MATCH pattern but want exact match by default, XMATCH is the newer MATCH; Microsoft lists it for Microsoft 365, Excel 2021, Excel 2024 and the web, not Excel 2016 or 2019. Always type the 0 in MATCH: its default, 1, is an approximate match that expects sorted data.
XLOOKUP in Google Sheets: what is different
Google Sheets has its own XLOOKUP function. Google’s syntax is XLOOKUP(search_key, lookup_range, result_range, missing_value, match_mode, search_mode). The names differ, but the order and the mode numbers match Excel: match_mode 0, 1, -1 and 2, and search_mode 1, -1, 2 and -2, with missing_value returning #N/A by default.
- Google says lookup_range must be a single row or column, and if result_range is more than one column the whole row of results is returned.
- Sheets’ VLOOKUP has the same approximate-match default as Excel: is_sorted is TRUE unless you set it, and Google recommends FALSE for an exact match.
- Google’s own example shows VLOOKUP needs an array such as {E2:E7, A2:A7} to look left, while XLOOKUP just takes E2:E7 as the search range and A2:A7 as the result range.
A Sheets user having XLOOKUP does not help a colleague who opens the exported .xlsx file in Excel 2016 or 2019; the version rules below still apply.
Which Excel versions support XLOOKUP?

XLOOKUP is available in Excel for Microsoft 365 (Windows and Mac), Excel for the web, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, and the Excel apps for iPad, iPhone and Android. Microsoft’s “What’s new in Excel 2021” pages for Windows and Mac name XLOOKUP as one of that release’s new functions. The XLOOKUP page states in a note that XLOOKUP is not available in Excel 2016 and Excel 2019, even though the page’s “Applies to” header also names those two versions; go by the note. VLOOKUP, INDEX and MATCH are listed for Excel 2016 and 2019 as well as the newer versions.
What colleagues on Excel 2016 or 2019 will see
Microsoft’s support article on the _xlfn. prefix describes the symptom: an _xlfn. prefix appears in front of a function the running version does not support, and when the formula is calculated it shows the #NAME? error. For XLOOKUP that would read like =_xlfn.XLOOKUP(…). Because the error appears on calculation, don’t count on the results saved in the file staying visible. Microsoft’s formula compatibility notes suggest replacing new functions with ones the older version has, or replacing the formulas with their results.
Before you send a workbook outside your team, search it: press Ctrl+F, open Options, set Within to Workbook and Look in to Formulas, and search for XLOOKUP, then XMATCH and FILTER. Excel’s Compatibility Checker (File > Info > Check for Issues > Check Compatibility on Windows) can also help flag functions that earlier versions lack.
When to keep VLOOKUP in shared files
- Anyone who edits the file is on Excel 2016, Excel 2019 or an older version, or you don’t know what version a client, auditor or regulator uses.
- The existing VLOOKUPs already use FALSE and return the right results; convert them when you next edit them, not all at once.
In each case, check that every VLOOKUP ends in FALSE or 0. That one argument prevents the missing-ID error shown above.
What to do now
- Audit existing lookups. Search the workbook for VLOOKUP formulas with only three arguments and add FALSE where an exact match is intended.
- Find out who opens the file. If anyone uses Excel 2016 or 2019, keep VLOOKUP or INDEX/MATCH in that workbook.
- Write new lookups as XLOOKUP in files used only on Microsoft 365, Excel 2021, Excel 2024 or the web, and use the cheat sheet to convert old ones as you edit them.
- Search for new functions before you send. Find XLOOKUP, XMATCH and FILTER in formulas before a workbook goes to a client, auditor or another department.
- Train the people who maintain the files. The recorded Excel advanced lookup functions webinar with David H. Ringstrom, CPA covers why VLOOKUP stops after the first match, why INDEX and MATCH often beats VLOOKUP or HLOOKUP, and the IFNA function. More sessions are listed under Excel and software webinars, or you can sign up for the 247Compliance newsletter.
Frequently asked questions
What is the difference between XLOOKUP and VLOOKUP?
VLOOKUP searches the first column of a table and returns a column you choose by number, and it runs an approximate match unless you add FALSE as the fourth argument. XLOOKUP takes a separate search range and return range, so it can look left, defaults to an exact match, has a built-in argument for the result when nothing is found, and can search from the last row up. XLOOKUP is not available in Excel 2016 or Excel 2019; VLOOKUP is.
Should I replace all my VLOOKUP formulas with XLOOKUP?
Not all at once. Use XLOOKUP for new formulas in workbooks that are opened only in Excel for Microsoft 365, Excel 2021, Excel 2024 or Excel for the web, and convert old VLOOKUPs when you next edit them. Keep VLOOKUP or INDEX/MATCH in files that anyone opens in Excel 2016 or 2019, and check that every VLOOKUP you keep ends in FALSE or 0.
Which Excel versions have XLOOKUP?
XLOOKUP is available in Excel for Microsoft 365 on Windows and Mac, Excel 2024 and Excel 2024 for Mac, Excel 2021 and Excel 2021 for Mac, Excel for the web, and the Excel apps for iPad, iPhone and Android. Microsoft’s XLOOKUP page states in a note that it is not available in Excel 2016 or Excel 2019, even though its Applies To header names those versions.
What happens if I send an XLOOKUP file to someone on Excel 2016?
Microsoft’s support article on the _xlfn. prefix says the prefix appears in front of a function the running version does not support, and the formula shows a #NAME? error when it is calculated. Before sending the file, search its formulas for XLOOKUP (and XMATCH or FILTER), and either use VLOOKUP or INDEX/MATCH in that workbook or replace the formulas with their results.
Can XLOOKUP use multiple criteria?
Yes. Search for 1 in a calculated array that multiplies the conditions, for example =XLOOKUP(1,(A2:A7=F2)*(B2:B7=G2),C2:C7), which returns the first row where both conditions are true. Add a search_mode of -1 to return the last matching row instead. VLOOKUP has no multiple-criteria form; in Excel 2016 or 2019 use INDEX and MATCH with a helper column that joins the keys, or as an array formula entered with Ctrl+Shift+Enter.
Is XLOOKUP faster than VLOOKUP?
Microsoft publishes no timing comparison between the two. Its performance guidance says exact-match lookups take longer the more cells they scan, approximate searches on sorted data are fast, and restricting the range scanned speeds up exact-match lookups. On a large file, time both formulas with a full recalculation (Ctrl+Alt+F9 on Windows) before switching for speed.
Does Google Sheets have XLOOKUP?
Yes. Google Sheets has an XLOOKUP function with the arguments search_key, lookup_range, result_range, missing_value, match_mode and search_mode, using the same mode numbers as Excel. Its VLOOKUP also defaults to an approximate match unless is_sorted is set to FALSE, which Google recommends for exact matches.
Go beyond VLOOKUP with better lookups
David H. Ringstrom, CPA’s recorded 90-minute webinar shows why VLOOKUP stops at the first match, why INDEX and MATCH is often the better option, and how IFNA, SUMIFS and other lookup functions make spreadsheets less prone to errors. Watch any time.
See the lookup functions webinarSources (20)
- Microsoft Support: XLOOKUP function (syntax, match_mode and search_mode values, Applies To list, note that XLOOKUP is not available in Excel 2016 and Excel 2019)
- Microsoft Support: VLOOKUP function (arguments, approximate match default, wildcards, common problems)
- Microsoft Support: INDEX function (array form, column_num 0)
- Microsoft Support: MATCH function (match_type default 1, wildcards with 0)
- Microsoft Support: XMATCH function (Applies To list, search_mode -1)
- Microsoft Support: IFNA function
- Microsoft Support: FILTER function (Applies To list)
- Microsoft Support: Dynamic array formulas and spilled array behavior (#SPILL!, not supported inside Excel tables)
- Microsoft Support: What’s new in Excel 2021 for Windows (XLOOKUP)
- Microsoft Support: What’s new in Excel 2021 for Mac (XLOOKUP)
- Microsoft Support: Formula compatibility issues in Excel (#NAME? when recalculated in earlier versions, _xlfn prefix, suggested fixes)
- Microsoft Support: Use Excel with earlier versions of Excel (retired article; File > Info > Check for Issues > Check Compatibility steps)
- Microsoft Support (archived copy, February 15, 2026): Issue: An _xlfn. prefix is displayed in front of a formula
- Microsoft Learn: Excel performance: Tips for optimizing performance obstructions (Improve lookup calculation time)
- Microsoft Learn: Excel recalculation (Ctrl+Alt+F9 full calculation)
- Google Docs Editors Help: XLOOKUP function
- Google Docs Editors Help: VLOOKUP function (is_sorted default)
- Microsoft Support: Find or replace text and numbers on a worksheet (Options: Within, Look in Formulas)
- Microsoft Support: Guidelines and examples of array formulas (legacy array formulas entered with Ctrl+Shift+Enter)
- Microsoft Support: IFERROR function (error types it catches)
This article is general information, not legal or tax advice. Check the official sources above or consult a qualified advisor for your situation.
How we research, check and correct articles: editorial policy. Spotted an error? Tell us.
LIVE WEBINAR · 3 DEC · 12:00 PM PT · 3:00 PM ET
Using Copilot to Format Legal Documents in Microsoft Word
Craig Brody · 60 min · from $179
Enroll



