XLOOKUP

Raise your hand if you love VLOOKUP? Me too! We Excel users have grown to love VLOOKUP over the years. But, XLOOKUP offers some advantages. XLOOKUP? That’s not a typo. Depending on your version of Excel and when you are reading this, you may see this function immediately, or it may be a while before it arrives. But either way, it is a goodie πŸ™‚Β  Thanks Bill J for the scoop on this, and Gary Z for the heads-up!

XLOOKUP

In summary, it is designed to return a related value, just like VLOOKUP … but it addresses some of the limitations of VLOOKUP and provides many additional options. Here is a screenshot of the Insert Function dialog which provides a description (and proof it exists):

Note: at the time I’m writing this, XLOOKUP is available in O365 w/Insiders Fast update channel. Depending on your version of Excel, you may not see it in your function list.

Let’s dig into the arguments:

=XLOOKUP(lookup_value, lookup_array, return_array, [match_mode], [search_mode])

Where:

  • lookup_value – value to find (same as VLOOKUP)
  • lookup_array – lookup column (different than VLOOKUP)
  • return_array – return column (different than VLOOKUP)
  • [match_mode] – 0 for exact match by default + more (different than VLOOKUP)
  • [search_mode] – 1 for first-to-last + more (different than VLOOKUP)

Let’s talk about these arguments in a bit more detail.

Lookup_value is similar to VLOOKUP, and represents the value we are trying to find.

Lookup_array represents a big change from VLOOKUP. Instead of defining the entire two-dimensional range (or table_array), we can define a single column. We specifically identify the lookup column range. This means that column order doesn’t matter anymore …. yay! The lookup column can be anywhere in the table.

Return_array is another big difference from VLOOKUP. Instead of defining the return column by index number (col_index_num), we can select the return column range. This is huge because it means if we insert a new worksheet column between the lookup and return columns, nothing breaks … yay! Plus, it can be located anywhere in the table, including to the left of the lookup column πŸ™‚

[match_mode] is an optional argument, and defaults to 0 if omitted. That means that if you don’t specify it, it will perform an exact match. This is different than VLOOKUP which defaults to doing a range lookup. With VLOOKUP, we can choose True or False, but XLOOKUP offers more options:

The wildcard character match is more of what we think about when we want to do a partial match. To use this option, we just add a wildcard character like asterisk (*) to the lookup value.

[search_mode] is an optional argument, and defaults to 1 when omitted. This replicates the behavior of VLOOKUP where it tries to find a match by starting at the top and working down.

We can also search from the bottom up, which is a nice option.

XLOOKUP starts with the solid foundation of VLOOKUP, and then enhances it. It is like the VLOOKUP we’ve always wanted and dreamed about πŸ™‚

XLOOKUP will help improve our workbooks by eliminating errors and providing more flexibility. Thank you Microsoft!!

Tip to job-seekers:

Here’s a tip for you if you are interviewing for a job and the interviewer asks you “Do you know Excel? Well, do you know VLOOKUP?”Β  You answer like this: “Yes I know VLOOKUP … but I prefer XLOOKUP. You do know about XLOOKUP, right?” … and blow their mind!!

 

Get a quick email notice when a new Excel article is available

  • This field is for validation purposes and should be left unchanged.

This article was written by Jeff Lenning

13 comments:

  1. Tom Herrington
    Reply

    I have Office 365, but this function is not in my version of Excel. What is the criteria to receive it?

    Thanks!

    1. Jeff Lenning Post author
      Reply

      It is being rolled out over time to O365 users depending on your office update channel preferences. Mine is set to the Insiders Fast channel, so give that a try and see if it gets installed. Hope it works!

      Thanks
      Jeff

  2. Shadrack
    Reply

    Lol. I love the last paragraph, “Tips to Job Seekers”
    You answer: β€œYes I know VLOOKUP … but I prefer XLOOKUP. You do know about XLOOKUP, right?” Lol. Excel just got better

    1. Jeff Lenning Post author
      Reply

      πŸ™‚

  3. Ben Connelly
    Reply

    *Reads article, runs to toolbox, tosses out INDEX-MATCH.*

    Amazing!

    1. Jeff Lenning Post author
      Reply

      Yes!!!

  4. shimsh
    Reply

    This seems fantastic! Which version of Excel is the earliest that this would be available on?

    1. Jeff Lenning Post author
      Reply

      It is being rolled out over time to O365 subscribers depending on your office update channel preferences. Mine is set to the Insiders Fast channel, so give that a try and see if it gets installed. Hope it works!

  5. Robert Joseph Brown
    Reply

    Where do you find the Insiders Fast Channel

  6. David N
    Reply

    I don’t have access to XLOOKUP and therefore can’t test these scenarios yet. So I’ll post them as challenge problems and see what you can tell us.

    Can lookup_array and return_array be literal or derived arrays as opposed to physical ranges, and I’m not talking about the “union” range you get with the age old CHOOSE trick? Say you wanted to locate the first value between 10 and 20. Can XLOOKUP mimic the following?

    Array (CSE) entered: INDEX(return_array,MATCH(1,(lookup_array>=10)*(lookup_array=10)*(lookup_array<=20),0),0))

    And can it return multiple, simultaneous matches? Not multiple columns for a single match as I've seen numerous people asking on other discussions and blogs, but something like the 2nd, 4th, and 7th matches for the name David at the same time.

    INDEX(return_array,AGGREGATE(15,6,(ROW(lookup_array)-ROW(lookup_header))/(lookup_array="David"),{2,4,7}))

    And what about the last match?

    INDEX(return_array,MATCH(2,INDEX(1/(lookup_array="David"),0),1))

    I could go on with at least two other challenge problems, but let's see the outcome on these first. If the answer to any one of them is no, then I propose that XLOOKUP is little more than the application of a new coat of paint on a tired and inferior function just because some think the combination of INDEX and MATCH (even in their simplest forms) are too much for anyone to possibly learn.

Leave a Reply

Your email address will not be published. Required fields are marked *