Master Excel: Step-by-Step Guide on Creating XLOOKUP
Are you tired of complex VLOOKUP and INDEX MATCH functions in Excel? Introducing XLOOKUP, a powerhouse function that simplifies horizontal and vertical lookups. It's designed to replace these older functions and much more. Today, we'll guide you through creating an XLOOKUP in Excel, step by step.
Before diving in, ensure you're using Excel for Microsoft 365 (the new version has the XLOOKUP function). If you're using an older version, we'll show you a workaround using dynamic arrays and spill range features.
Understanding XLOOKUP Syntax
The basic syntax of the XLOOKUP function is as follows:
XLOOKUP(lookup_Lookup_Array, lookup_vector, returnarray)
We'll break down each component:
lookup_Lookup_Array
The cell or range you're looking up in.
lookup_vector
The range where the lookup value is found.
returnarray
The cell or range that XLOOKUP returns a value from, based on the match.
Creating an XLOOKUP Function
Let's say you have a list of fruits with their respective prices. You want to lookup the price of a specific fruit using XLOOKUP.
Assume your data looks like this:
| Fruit | Price |
|---|---|
| Apple | 0.5 |
| Banana | 0.3 |
| Orange | 0.7 |
To lookup the price of 'Apple', use:
=XLOOKUP(B4,'Fruit', 'Price')
Wildcard and Exact Match Options
By default, XLOOKUP uses approximate matching. To make it an exact match, use match_mode:
XLOOKUP(lookup_Lookup_Array, lookup_vector, returnarray, [match_mode])
Returning Multiple Values
You can return multiple values using if_empty:
XLOOKUP(lookup_Lookup_Array, lookup_vector, returnarray, [match_mode], [search_mode], [if_empty])
Workaround for Older Excel Versions
If you're using an older version that doesn't have XLOOKUP, use dynamic arrays and spill range features for a similar effect:
=FILTER(Price, Fruit=B4)
Now you're equipped to create powerful XLOOKUPs in Excel! Happy calculating, and until next time, keep exploring Excel's vast potential.