October 29th Update
While preparing XLOOKUP for general release, we have been listening to the incredible feedback from our Insiders. A leading suggestion was that XLOOKUP could be made even better by adding an [if_not_found] argument. We’ve heard you loud and clear and have gone ahead and added it!
We initially rolled out [if_not_found] as the 6th argument to XLOOKUP, but will promote it to the 4th argument as it will see more usage than [match_mode] and [search_mode]. This change will alter the behavior of any pre-existing XLOOKUPs that use four or more arguments. If you have any XLOOKUPs that do, you will need to revise them once you get the update to ensure they continue to calculate as you intended.
We are excited to announce XLOOKUP, successor to the iconic VLOOKUP function. Before I describe XLOOKUP, I want to take a moment to reflect on VLOOKUP's incredible history and impact on spreadsheeting.
VLOOKUP has been with Excel from the beginning; it was included in Excel 1 for Macintosh released in 1985. For 34 years, VLOOKUP has been the first lookup function learned by Excel users and our 3rd most used function (after SUM and AVERAGE). In fact, it’s so fundamental to spreadsheeting that most users can recall the sense of achievement they felt when they first mastered VLOOKUP, myself included.
XLOOKUP is named for its ability to look both vertically and horizontally (yes it replaces HLOOKUP too!). In its simplest form, XLOOKUP needs just 3 arguments to perform the most common exact lookup (one fewer than VLOOKUP). Let’s consider its signature in the simplest form:
XLOOKUP(lookup_value,lookup_array,return_array)
Let's see it in action:
To perform advanced lookups, you can use XLOOKUP’s optional 4th and 5th mode arguments: match_mode and search_mode.
XLOOKUP(lookup_value,lookup_array,return_array,[match_mode],[search_mode])
match_mode allows you to set the type of match you’d like to perform. The options are:
Use zero to perform an exact match. This is the default.
Use 1 or -1 to allow a match against the nearest smaller (or larger) item when there is no exact match.
Use 2 to do a simple wildcard match where ? means match any character and * means match any run of characters.
search_mode lets you configure the type and direction of search. The options are:
Use 1 or -1 to search from first-to-last or last-to-first.
Use 2 or -2 to do a binary search on sorted data. This is included for expert users only.
While VLOOKUP was widely used, it has several well-known limitations which XLOOKUP overcomes:
VLOOKUP and HLOOKUP will both continue to be supported by Excel. That said, we strongly recommend using XLOOKUP in favor of VLOOKUP and HLOOKUP because XLOOKUP is simpler to use and has none of the limitations listed above.
In addition to XLOOKUP we are also launching XMATCH which has a similar signature to XLOOKUP but returns the index of the matching item. XMATCH is both easier to use and more capable than its predecessor MATCH.
XMATCH(lookup_value,lookup_array,[match_mode],[search_mode])
You can learn more about XLOOKUP and XMATCH from these resources:
XLOOKUP and XMATCH are available for users signed up for the Office 365 Insiders Program starting today and will continue rolling out to Insiders over the next few weeks. Gradual roll outs allow us to gather feedback and ensure feature quality.
To stay connected to Excel and its community, read the Excel blog posts and send us ideas and suggestions via UserVoice. You can also follow Excel on Facebook and Twitter.
Joe McDaid (@jjmcdaid)
Program Manager, Excel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.