Excel Practice Test

โ–ถ

If you have ever wrestled with a stubborn lookup formula, you already know why XLOOKUP in Excel has become one of the most celebrated additions to the spreadsheet world since Microsoft introduced it in 2019. XLOOKUP is a single, modern function designed to replace VLOOKUP, HLOOKUP, and most uses of INDEX/MATCH. It searches a range, returns a corresponding value from another range, and handles errors, approximate matches, and reverse searches without the awkward column counting that defined older formulas.

The function is now available in Excel 365, Excel 2021, Excel 2024, and Excel for the web, which means most professionals working in modern workplaces have access to it. Once you learn the basic syntax, it becomes intuitive: tell Excel what to look for, where to search, and what to return. The function does the rest, including defaulting to an exact match and letting you specify what to display when nothing is found, which eliminates the need for IFERROR wrappers.

Why does this matter for everyday spreadsheet users? Because lookups are everywhere. Whether you are matching employee IDs to salary bands, joining product codes to inventory levels, or pulling student grades into a master report, you need a function that is fast, readable, and forgiving. VLOOKUP, the classic workhorse, has well-documented limitations: it only searches left to right, breaks when columns are inserted, and forces an exact-versus-approximate flag in a confusing fourth argument. XLOOKUP fixes all of these issues.

This guide will walk you through every aspect of XLOOKUP, starting with the basic syntax and working up to advanced patterns like two-way lookups, dynamic arrays, wildcard searches, and reverse lookups. You will see real examples drawn from finance, HR, sales, and operations, along with side-by-side comparisons to VLOOKUP so you understand exactly what you gain by switching. We will also cover common errors, performance considerations, and edge cases that catch new users off guard.

By the end of this article, you will be comfortable writing XLOOKUP formulas for almost any business scenario, and you will know when to reach for related tools like FILTER, INDEX/MATCH, or Power Query instead. We have also included practice quizzes throughout so you can test your knowledge as you go and reinforce what you learn with concrete problems.

If you have used the popular vlookup excel function for years, do not worry: nothing in your existing spreadsheets will break. XLOOKUP is additive, not destructive. You can keep your old formulas working while gradually migrating to the new approach in any new workbooks you create. Many teams adopt a hybrid strategy where legacy reports stay on VLOOKUP and any new dashboard, model, or analysis is built fresh on XLOOKUP from day one.

Whether you are a beginner just learning lookup functions or a power user looking to modernize your toolkit, XLOOKUP deserves a permanent place in your formula vocabulary. Let us dive in and explore everything this remarkable function can do, one practical example at a time, with the kind of detail you can apply to your own real spreadsheets tomorrow morning.

XLOOKUP in Excel by the Numbers

๐Ÿ“…
2019
Year Released
๐Ÿ”ข
6
Function Arguments
โšก
10x
Faster Searches
๐ŸŽฏ
5
Match Modes
๐Ÿ“Š
100%
VLOOKUP Coverage
Try Free XLOOKUP in Excel Practice Questions

Breaking Down the XLOOKUP Syntax

๐Ÿ” lookup_value

The value you want to find โ€” a cell reference, text string, number, or expression. This is the same idea as VLOOKUP's first argument and works identically across all data types.

๐Ÿ“‹ lookup_array

The single column or row Excel should search inside. Unlike VLOOKUP, you pass only the lookup column, not the whole table, which makes the formula faster and immune to column insertions.

๐Ÿ“ค return_array

The column or row Excel should pull the result from. This can be to the left, right, above, or below the lookup_array โ€” XLOOKUP does not care about direction.

๐Ÿ›ก๏ธ if_not_found

Optional text or value to display when no match is found. Replaces clunky IFERROR wrappers. Try "Not Found" or 0 to keep dashboards clean and avoid the dreaded #N/A error.

โš™๏ธ match_mode + search_mode

Optional flags that control exact vs approximate matching and the search direction. Use search_mode -1 for reverse lookups, or 2 for a binary search on sorted data.

The most common question newcomers ask is simple: how does XLOOKUP compare to the legendary vlookup excel function that has powered business spreadsheets for over two decades? The short answer is that XLOOKUP wins on almost every dimension โ€” readability, flexibility, performance, and error handling โ€” while VLOOKUP retains a place only in spreadsheets that must support older Excel versions like 2016 or 2019 perpetual licenses without the cumulative update path to XLOOKUP.

VLOOKUP requires you to count columns. If your table has the lookup value in column A and you want to return data from column F, you write the number 6 as the third argument. Insert a new column in the middle of the table and your formula silently returns the wrong column. XLOOKUP removes this fragility entirely by asking for the actual range you want returned. You can insert columns, move data, or restructure the sheet, and the formula keeps working as long as the named ranges still exist.

VLOOKUP also defaults to an approximate match when you omit the fourth argument, which has caused untold hours of debugging across the corporate world. Forget the FALSE flag and suddenly your sales report shows wrong commissions because Excel returned the nearest lower match instead of the exact ID. XLOOKUP flips this convention: the default is an exact match, which is what 95 percent of business users actually want. Approximate matching is still available, but you opt in deliberately rather than by accident.

Another huge advantage is the ability to search to the left. VLOOKUP can only return values to the right of the lookup column, which forces analysts to rearrange data or build INDEX/MATCH formulas as a workaround. XLOOKUP does not have this restriction. You can look up an employee name in column F and return their employee ID from column A in a single, readable formula, which simplifies many real-world reports immediately.

Performance is another quiet win. Because XLOOKUP only scans the columns you reference rather than the entire table array, calculation times in large workbooks drop noticeably. In a test on a million-row dataset, an XLOOKUP formula finished in roughly one-third the time of an equivalent VLOOKUP. Multiply that across thousands of cells and your model becomes dramatically snappier, especially when paired with structured table references that Excel can optimize internally.

The if_not_found argument is perhaps the most underappreciated improvement. Instead of wrapping your formula in IFERROR or IFNA to suppress ugly #N/A errors, you simply pass a fourth argument with the text or value you want to show. This keeps formulas shorter, easier to audit, and cleaner when you copy them into reports for executives who do not want to see error codes next to their KPIs every Monday morning when they open the weekly performance dashboard.

Finally, XLOOKUP plays beautifully with dynamic arrays. If your return_array spans multiple columns, the formula spills the entire row across adjacent cells automatically. This single capability eliminates the need to write five separate VLOOKUP formulas to pull five fields from a customer record, which is one of the most common and tedious patterns in legacy spreadsheets across the finance and operations world today.

FREE Excel Basic and Advance Questions and Answers
Test your XLOOKUP and lookup function knowledge with mixed-difficulty Excel practice questions.
FREE Excel Formulas Questions and Answers
Practice writing real Excel formulas including XLOOKUP, IF, SUMIFS, and dynamic array functions.

Practical XLOOKUP Examples for Real Work

๐Ÿ“‹ Basic Lookup

The simplest XLOOKUP retrieves one value based on a key. Imagine a price list in columns A through B with product codes in column A and prices in column B. To find the price of product code P-204, you write =XLOOKUP("P-204", A2:A100, B2:B100). Excel returns the matching price instantly, with no need to count columns or remember a FALSE flag at the end.

This formula reads almost like a plain English sentence: look up P-204 inside the codes column and return the matching price column entry. Pair it with cell references instead of hardcoded text to make it dynamic โ€” for instance, =XLOOKUP(D2, A2:A100, B2:B100) โ€” and you have a reusable lookup that updates as soon as you change the value in D2 to any other product code in your dataset.

๐Ÿ“‹ Lookup with If Not Found

Errors happen when a key is missing from the source table. Rather than wrap the formula in IFERROR, use the fourth argument: =XLOOKUP(D2, A2:A100, B2:B100, "Not in catalog"). When the product code in D2 does not exist, the cell now displays the friendly text instead of #N/A. This single change makes dashboards far more presentable to non-technical stakeholders.

You can also pass numeric defaults, which is useful in financial models. Replacing the message with a zero โ€” =XLOOKUP(D2, A2:A100, B2:B100, 0) โ€” lets downstream SUM and AVERAGE functions continue working even when some lookups fail. This is a small ergonomic improvement that compounds across hundreds of formulas in a complex monthly close model or budget consolidation workbook.

๐Ÿ“‹ Two-Way Lookup

XLOOKUP truly shines when you nest it to perform a two-way lookup. Suppose you have monthly sales by region with regions in column A and months in row 1. To find March sales for the East region, you write =XLOOKUP("East", A2:A10, XLOOKUP("March", B1:M1, B2:M10)). The inner XLOOKUP returns the March column, and the outer XLOOKUP picks the East row from that returned column array.

This pattern replaces the older INDEX/MATCH/MATCH combination with something far more readable. New analysts can follow the logic without learning two functions, and the formula self-documents because each XLOOKUP call clearly names what it is searching for. It is one of the cleanest examples of why XLOOKUP has become the default lookup tool in modern Excel training programs and corporate spreadsheet style guides.

Should You Switch From VLOOKUP to XLOOKUP?

Pros

  • Defaults to exact match, eliminating a common source of silent errors in business reports
  • Can search left, right, up, or down without complex INDEX/MATCH workarounds
  • Built-in if_not_found argument removes the need for IFERROR wrappers
  • Survives column insertions because it references actual ranges, not column numbers
  • Faster on large datasets because it only scans referenced columns
  • Returns entire rows or columns as dynamic arrays for one-formula multi-field pulls
  • Supports wildcard, exact, next-larger, and next-smaller match modes in a clear flag

Cons

  • Not available in Excel 2019 perpetual or earlier versions still common in some firms
  • Files saved with XLOOKUP open as #NAME? errors when shared with older Excel users
  • Existing teams trained on VLOOKUP need retraining time to adopt the new syntax
  • Some legacy macros and add-ins generate VLOOKUP code that requires manual updates
  • Approximate match behavior differs slightly, which can surprise long-time VLOOKUP users
  • Spill behavior on dynamic arrays can clash with adjacent data and throw #SPILL errors
FREE Excel Functions Questions and Answers
Practice 50+ Excel function questions covering XLOOKUP, INDEX, MATCH, FILTER, and more.
FREE Excel MCQ Questions and Answers
Multiple choice Excel questions to test lookup, formula, and formatting skills.

XLOOKUP Best Practices Checklist

Always pass an if_not_found argument to keep dashboards free of #N/A errors
Use structured table references like Sales[Region] instead of fixed cell ranges
Prefer XLOOKUP over nested IFERROR(VLOOKUP()) for cleaner, more maintainable formulas
Reserve approximate match (match_mode 1 or -1) for sorted numeric data only
Use search_mode -1 to find the last matching value in a column of duplicates
Test formulas against edge cases like blank lookup values and trailing spaces
Combine XLOOKUP with FILTER when you need multiple matches instead of just the first
Document any XLOOKUP that returns an array so colleagues understand the spill range
Avoid XLOOKUP across closed workbooks โ€” the calculation overhead can be significant
Convert legacy VLOOKUP formulas gradually rather than all at once to limit risk
The single argument that saves the most time

The if_not_found argument is the most underused feature of XLOOKUP. Adding a simple fallback like 0 or "Missing" eliminates the IFERROR wrapper that doubled the length of legacy formulas. Across a 10,000-cell model, this one habit can cut formula characters by 40% and make audits dramatically faster for your entire finance or operations team going forward.

Even though XLOOKUP is forgiving, you will eventually run into errors. Understanding what each error message means and how to fix it is the difference between a five-minute repair and a frustrating afternoon of trial and error. The most common errors are #N/A, #VALUE!, #REF!, #SPILL!, and #NAME?, and each has a distinct cause that maps to a specific fix in your formula or your data layout.

The #N/A error appears when XLOOKUP cannot find the lookup value in the lookup_array. This is the most common error and usually points to a data quality issue rather than a formula bug. Check for leading or trailing spaces in either the lookup value or the source column, mismatched data types (a number stored as text will not match a true number), and capitalization differences if you are using exact match. The TRIM, CLEAN, and VALUE functions are your best friends for cleaning input data before lookups.

A #VALUE! error usually means the lookup_array and return_array have different sizes. If your lookup column has 100 rows but your return column has 99, Excel cannot align them and throws an error. Always make sure both ranges span the same number of rows (or columns, if you are doing a horizontal lookup). Using structured table references avoids this problem entirely because tables guarantee matching row counts across all columns automatically.

The #REF! error appears when one of the referenced ranges has been deleted, often after restructuring a worksheet. The fix is straightforward: rebuild the reference to point at the current data location. This is one area where named ranges shine โ€” if you reference Sales_Table[Amount] instead of B2:B500, you can rearrange the sheet freely without breaking the formula, which is a habit worth building early in any modeling project.

The #SPILL! error is unique to dynamic array functions like XLOOKUP when it returns an array. It means the spill range is blocked by other content in the worksheet. Either clear the cells in the spill range or move your XLOOKUP formula to an area with enough empty space below and to the right. You can also wrap the formula in INDEX or use the @ operator to force a single-cell return instead of a spilled array result.

Finally, #NAME? typically means the user opening the file does not have a version of Excel that supports XLOOKUP. This happens when you share a workbook with a colleague using Excel 2019 perpetual or earlier. The fix is either to upgrade their Excel installation, switch to Microsoft 365, or rewrite the lookup using INDEX/MATCH for backward compatibility while you negotiate the upgrade with the IT department in your organization.

Beyond errors, performance is a real consideration in big workbooks. While XLOOKUP is faster than nested IFERROR(VLOOKUP()) chains, calling it tens of thousands of times across linked workbooks can still slow recalculation. Strategies include consolidating data with Power Query, replacing repeated lookups with helper columns, and switching the calculation mode to manual while you build out a model before flipping it back to automatic for final use.

Once you master basic XLOOKUP, several advanced patterns unlock truly powerful spreadsheet capabilities. The first is reverse lookups using search_mode -1, which tells XLOOKUP to start searching from the bottom of the array instead of the top. This is incredibly useful when you have a transaction log with multiple entries per customer and you want the most recent transaction. A formula like =XLOOKUP("Acme Corp", A2:A1000, D2:D1000, , 0, -1) returns the latest matching record.

The second advanced pattern is wildcard matching with match_mode 2. Set this flag and you can use asterisks and question marks in your lookup value to find partial matches. For example, =XLOOKUP("Smith*", A2:A100, B2:B100, , 2) returns the first row where the lookup column starts with Smith. This is invaluable for cleaning messy data, matching company names with inconsistent suffixes like Inc, LLC, or Corp, and building flexible search interfaces for non-technical users.

Returning multiple columns at once is another advanced technique that takes advantage of dynamic arrays. If you want to pull a customer name, email, and phone number in one shot, point return_array at the whole three-column range: =XLOOKUP(D2, Customers[ID], Customers[[Name]:[Phone]]). The result spills across three cells automatically, eliminating the need for three separate formulas. This single capability replaces hours of formula maintenance in customer relationship templates and operational dashboards.

Combining XLOOKUP with FILTER, SORT, and UNIQUE creates a complete modern lookup toolkit. FILTER returns every match instead of just the first one, SORT orders the results, and UNIQUE removes duplicates. Together they replace pivot tables for many ad hoc analysis needs. A formula like =SORT(UNIQUE(FILTER(B2:B1000, A2:A1000="East"))) produces a clean, sorted list of unique values in column B where column A equals East, all without manual sorting or pivot table refreshes between iterations.

XLOOKUP also works with criteria built from concatenation, enabling multi-column lookups without helper columns. If you want to find a price based on both product and region, you can write =XLOOKUP(D2&E2, A2:A100&B2:B100, C2:C100). The concatenation creates a virtual key on both sides of the lookup. Entered as a regular formula in Microsoft 365, this works thanks to dynamic array evaluation, replacing the older INDEX/MATCH array formula pattern that required Ctrl+Shift+Enter in legacy versions of Excel.

For exam prep and certification study, knowing these advanced patterns puts you ahead of most candidates. Microsoft Office Specialist tests and many corporate Excel assessments now include XLOOKUP questions, often comparing it against the legacy vlookup excel approach to test whether you understand both ecosystems. Practice writing each pattern from scratch so the syntax becomes second nature under time pressure during a proctored testing situation when you cannot reference outside notes or examples.

Finally, do not overlook the synergy between XLOOKUP and named ranges. Defining a name like ProductPrices for your lookup table makes formulas read like sentences: =XLOOKUP(D2, ProductCodes, ProductPrices, "N/A"). New team members can understand what the formula does without inspecting every range reference, which dramatically reduces onboarding time and the risk of accidental edits to the source data ranges during routine cleanup or restructuring tasks in your model.

Practice XLOOKUP & VLOOKUP Excel Formulas

Now that you understand the syntax, advantages, and advanced patterns of XLOOKUP, the final question is how to actually integrate it into your daily Excel work. The best approach is incremental: start by using XLOOKUP in every new formula you write, while leaving existing VLOOKUP and INDEX/MATCH formulas alone unless they break or need significant edits. This avoids the risk of regression bugs and builds your XLOOKUP muscle memory naturally over weeks of normal work rather than through artificial drills.

A useful exercise is to take one of your existing reports and rewrite a single VLOOKUP as an XLOOKUP, then compare the two side by side. You will immediately appreciate the readability difference and start spotting opportunities to consolidate nested IFERROR wrappers into clean if_not_found arguments. Many analysts report that this exercise alone reduces total formula characters by 30 to 50 percent in their working models, with a corresponding improvement in audit speed and the time required to onboard new colleagues to the spreadsheet.

For shared team workbooks, consider creating a short style guide that documents when to use XLOOKUP, what defaults to set for if_not_found, and how to name ranges consistently. Even a one-page document dramatically improves consistency across a team and reduces the number of #N/A errors that show up in executive dashboards each month, which keeps stakeholders happy and reduces the volume of urgent Friday afternoon requests to fix broken summary numbers in the weekly pack.

Pair your XLOOKUP learning with related skills like how to merge cells in excel, how to freeze a row in excel, and how to create a drop down list in excel for a complete data analysis foundation. These features work hand in hand with lookup functions to build polished, interactive spreadsheets. A frozen header row paired with a drop-down list for the lookup value creates a mini search interface that even non-technical users can operate confidently without breaking the underlying formulas during their daily reporting tasks.

Do not neglect testing. Build a small test sheet with known inputs and expected outputs, then run your XLOOKUP formulas against it before deploying to a production workbook. This catches edge cases like blank lookup values, trailing spaces, and type mismatches before they cause embarrassing errors in front of stakeholders. A simple set of 10 to 20 test cases covering the most common scenarios is enough to give you confidence that the formula behaves correctly across the full range of expected real-world inputs.

When you find yourself reaching for complex array formulas or nested IF statements, pause and ask whether XLOOKUP, FILTER, or another dynamic array function could simplify the logic. The modern Excel toolkit is dramatically more expressive than the version most professionals learned a decade ago, and many problems that once required custom VBA can now be solved with a single dynamic array formula in five seconds. Staying current with these capabilities is one of the highest-leverage skills you can build in 2026.

Finally, keep practicing with real datasets. Download sample CSV files from your industry, build practice dashboards, and challenge yourself to solve common reporting problems using only XLOOKUP and its dynamic array siblings. The more reps you put in, the faster you will write production-quality formulas under deadline pressure during your real working day. This is exactly how senior analysts develop the fluency that lets them tackle messy ad hoc requests in minutes instead of hours, and it is well within reach for any motivated learner.

FREE Excel Questions and Answers
Comprehensive Excel certification practice covering XLOOKUP, formulas, formatting, and analysis.
FREE Excel Trivia Questions and Answers
Fun Excel trivia and quick-fire questions to sharpen your spreadsheet knowledge daily.

Excel Questions and Answers

What is XLOOKUP in Excel and how is it different from VLOOKUP?

XLOOKUP is a modern lookup function introduced in 2019 that replaces VLOOKUP, HLOOKUP, and most uses of INDEX/MATCH. The key differences are that XLOOKUP defaults to exact match, can search left as well as right, includes built-in error handling through the if_not_found argument, and is immune to column insertions because it references actual ranges rather than column numbers as VLOOKUP requires.

Is XLOOKUP available in all versions of Excel?

No. XLOOKUP requires Microsoft 365, Excel 2021, Excel 2024, or Excel for the web. It is not available in Excel 2019 perpetual, Excel 2016, or earlier versions. If you share a workbook containing XLOOKUP with a user on an older version, the formula will appear as #NAME? errors. Confirm everyone has a compatible Excel version before deploying XLOOKUP in shared team spreadsheets.

Can XLOOKUP return multiple values at once?

Yes. If you pass a multi-column range as the return_array argument, XLOOKUP spills the entire matching row across adjacent cells thanks to dynamic arrays. For example, return_array set to Customers[[Name]:[Phone]] returns name, email, and phone in three adjacent cells from one formula. This replaces three separate VLOOKUP formulas and is one of the biggest productivity gains XLOOKUP offers over its predecessor.

How do I handle #N/A errors in XLOOKUP?

Use the fourth argument, if_not_found, to specify a value or message to display when no match is found. For example, =XLOOKUP(D2, A:A, B:B, "Not Found") returns the text Not Found instead of the #N/A error. You can also pass 0, a blank string, or any other value. This eliminates the need to wrap the formula in IFERROR or IFNA, keeping the formula much shorter and more readable.

Can XLOOKUP perform a reverse search?

Yes. Set the sixth argument, search_mode, to -1 to start the search from the bottom of the array instead of the top. This returns the last matching value, which is invaluable for finding the most recent transaction in a log sorted by date or the latest entry for a customer in a chronological dataset. A binary search option (2 or -2) is also available for sorted data, offering improved performance on very large ranges.

How does XLOOKUP compare in speed to VLOOKUP?

XLOOKUP is generally faster than VLOOKUP, especially on large datasets, because it only scans the specific columns you reference rather than the entire table array. In benchmark tests on million-row datasets, XLOOKUP completed lookups in roughly one-third the time of an equivalent VLOOKUP. The difference is most noticeable in workbooks with thousands of lookup formulas, where the cumulative time savings can be substantial during recalculation cycles.

Can I use wildcards with XLOOKUP?

Yes, but you must opt in by setting the fifth argument, match_mode, to 2. With wildcard matching enabled, you can use asterisks for any sequence of characters and question marks for any single character. For example, =XLOOKUP("Smith*", A:A, B:B, , 2) finds the first entry starting with Smith. This is useful for matching company names with inconsistent suffixes or building flexible search interfaces for non-technical users.

What is the if_not_found argument and when should I use it?

The if_not_found argument is the fourth parameter of XLOOKUP and specifies what to display when no match is found. Use it on virtually every XLOOKUP you write to avoid raw #N/A errors appearing in your reports. Common values include the text Not Found, the number 0 for numeric calculations, or an empty string for visually clean dashboards. This single argument replaces the older pattern of wrapping every lookup in IFERROR.

Can XLOOKUP look up values to the left?

Yes. Unlike VLOOKUP, which only returns values to the right of the lookup column, XLOOKUP can return values from any direction. You can place the lookup_array and return_array anywhere in your worksheet relative to each other. This eliminates the need for INDEX/MATCH workarounds whenever your source data is organized in an order that does not align with VLOOKUP's left-to-right restriction, which is a common situation in real business datasets.

Should I rewrite all my existing VLOOKUP formulas as XLOOKUP?

Not necessarily. Existing VLOOKUP formulas continue to work, so there is no urgency to migrate. The recommended approach is to use XLOOKUP for all new formulas while leaving working VLOOKUP code in place. Rewrite legacy formulas only when you need to edit them anyway or when they break. This gradual migration limits the risk of introducing bugs and lets you build XLOOKUP fluency through normal day-to-day work rather than a disruptive rewrite project.
โ–ถ Start Quiz