XLOOKUP function in Excel with formula examples

The tutorial introduces XLOOKUP - the new function for vertical and horizontal lookup in Excel. Left lookup, last match, Vlookup with multiple criteria and a lot more things that used to require a rocket science degree to accomplish have now become as easy as ABC.

Whenever you need to look up in Excel, which function would you use? Is it a cornerstone VLOOKUP or its horizontal sibling HLOOKUP? In a more complex case, will you rely on the canonical INDEX MATCH combination or commit the job to Power Query? The good news is that you do not have choose anymore - all these methods are making way for a more powerful and versatile successor, the XLOOKUP function.

How is XLOOKUP better? In many ways! It can look vertically and horizontally, to the left and above, search with multiple criteria, and even return a whole column or row of data, not just one value. It has taken Microsoft over 3 decades, but finally they've managed to design a robust function that overcomes many frustrating errors and weaknesses of VLOOKUP.

What's the catch? Alas, there is one. The XLOOKUP function is only available in Excel for Microsoft 365, Excel 2021, and Excel for the web.

Excel XLOOKUP function - syntax and uses

The XLOOKUP function in Excel searches a range or an array for a specified value and returns the related value from another column. It can look up both vertically and horizontally and perform an exact match (default), approximate (closest) match, or wildcard (partial) match.

The syntax of the XLOOKUP function is as follows:

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

The first 3 arguments are required and the last three are optional.

  • Lookup_value - the value to search for.
  • Lookup_array - the range or array where to search.
  • Return_array - the range or array from which to return values.
  • If_not_found [optional] - the value to return if no match is found. If omitted, an #N/A error is returned.
  • Match_mode [optional] - the match type to perform:
    • 0 or omitted (default) - exact match. If not found, an #N/A error is returned.
    • -1 - exact match or next smaller. If an exact match is not found, the next smaller value is returned.
    • 1 - exact match or next larger. If an exact match is not found, the next larger value is returned.
    • 2 - wildcard character match.
  • Search_mode [optional] - the direction of search:
    • 1 or omitted (default) - to search from first to last.
    • -1 - to search in reverse order, from last to first.
    • 2 - binary search on data sorted ascending.
    • -2 - binary search on data sorted descending.

    According to Microsoft, binary search is included for advanced users. It is a special algorithm that finds the position of a lookup value within a sorted array by comparing it to the middle element of the array. A binary search is much faster than a regular search but works correctly only on sorted data.

Basic XLOOKUP formula

To gain more understanding, let's build an XLOOKUP formula in its simplest form to perform an exact lookup. For this, we will only need the first 3 arguments.

Supposing, you have a summary table with information about the five oceans on the Earth. You want to get the area of a specific ocean input in G4 (lookup_value). With the ocean names in B4:B8 (lookup_array) and areas in D4:D8 (return_array), the formula goes as follows:

=XLOOKUP(G4, B4:B8, D4:D8)

Translated into plain English, it says: search for the G4 value in B4:B8 and return a value from D4:D8 in the same row. No column index numbers, no sorting, no other ridiculous quirks of Vlookup! It just works :)

If needed, you can "hardcode" the lookup value directly in a formula like this:

=XLOOKUP("Indian", B4:B8, D4:D8)

Excel XLOOKUP function

XLOOKUP availability

As of now, the XLOOKUP function is available in Excel 365, Excel 2021, and Excel for the web. It's important to note that XLOOKUP is not backward compatible, meaning it won't function in earlier versions.

How is XLOOKUP better than VLOOKUP?

XLOOKUP is a powerful function that surpasses VLOOKUP in many aspects. It offers more capabilities, versatility and efficiency. Here are the top 10 features that make it the ultimate lookup function in Excel:

  1. Vertical and horizontal lookup. The XLOOKUP function got its name due to its ability to look up both vertically and horizontally.
  2. Look in any direction: right, left, bottom or up. While VLOOKUP can only search in the leftmost column and HLOOKUP in the topmost row, XLOOKUP has no such limitations. The notorious left lookup in Excel is not a pain anymore!
  3. Exact match by default. In most situations, you will be looking for an exact match, and XLOOKUP returns it by default (unlike the VLOOKUP function that defaults to approximate match). Of course, you can get XLOOKUP to perform an approximate match too if needed.
  4. Partial match with wildcards. When you know only some part of the lookup value, not all of it, a wildcard match comes in handy.
  5. Search in reverse order. Earlier, to get the last occurrence, you had to reverse the order of your source data. Now, you simply set the search_mode argument to -1 to force your Xlookup formula to search from the back and return the last match.
  6. Return multiple values. By manipulating with the return_array argument, you can pull an entire row or column of data related to your lookup value.
  7. Search with multiple criteria. Excel XLOOKUP handles arrays natively, which makes it possible to perform lookup with multiple criteria.
  8. If error functionality. Traditionally, we use the IFNA function to trap #N/A errors. XLOOKUP incorporates this functionality in the if_not_found argument allowing to output your own text if no valid match is found.
  9. Column insertions/deletions. One of the most irritating issues with VLOOKUP is that adding or removing columns breaks a formula because the return column is identified by its index number. With XLOOKUP, you supply the return range, not number, meaning you can insert and remove as many columns as you need without breaking anything.
  10. Better performance. VLOOKUP could slow down your worksheets because it includes the entire table in calculations, which results in processing far more cells than actually needed. XLOOKUP handles only the lookup and return arrays that it truly depends on.

For more information, please see Difference between VLOOKUP and XLOOKUP.

How to use XLOOKUP in Excel - formula examples

The following examples demonstrate the most useful XLOOKUP features in action. Additionally, you will discover a couple non-trivial uses that will take your Excel lookup skills to a new level.

Look up vertically and horizontally

Microsoft Excel used to have two functions for different lookup types, each having its own syntax and usage rules: VLOOKUP to look vertically in a column and HLOOKUP to look horizontally in a row.

The XLOOKUP function can do both with the same syntax. The difference is in what you provide for the lookup and return arrays.

For v-lookup, supply columns:

=XLOOKUP(E2, A3:A7, B3:B7)
Vertical XLOOKUP

For h-lookup, enter rows instead of columns:

=XLOOKUP(I1, B1:F1, B2:F2)
Horizontal XLOOKUP

Left lookup performed natively

In earlier versions of Excel, INDEX MATCH formula was the only reliable way to look to the left or above. Now, you no longer need to combine two functions where one would suffice. Just specify the target lookup array, and XLOOKUP will handle it without a problem regardless of its location.

As an example, let's add the Rank column to the left of our sample table. The goal is to get the rank of the ocean input in F1. VLOOKUP would stumble here because it can only return a value from a column to the right of the lookup column. An Xlookup formula copes with ease:

=XLOOKUP(F1, B2:B6, A2:A6)
Left XLOOKUP in Excel

In a similar manner, you can look above when searching horizontally in rows.

XLOOKUP with exact and approximate match

The match behavior is controlled by the 5th argument called match_mode. By default, an exact match is performed.

Please pay attention that even when you choose an approximate match (match_mode set to 1 or -1), the function will still search for an exact match first. The difference is in what it returns if an exact lookup value is not found.

Match_mode argument:

  • 0 or omitted - exact match; if not found - #N/A error.
  • -1 - exact match; if not found - next smaller item.
  • 1 - exact match; if not found - next larger item.

Exact match XLOOKUP

This is the option you probably use 99% of the time you do lookup in Excel. Since an exact match is XLOOKUP's default behavior, you can omit match_mode and supply only the first 3 required arguments.

In some situations, however, an exact match won't work. A typical scenario is when your lookup table does not contain all the values, but rather "milestones" or "bounds" like quantity-based discounts, sales-based commissions, etc.

Our sample lookup table shows the correlation between exam scores and grades. As you can see in the screenshot below, an exact match works only when the score of a particular student matches the value in the lookup table exactly (like Christian in row 3). In all other cases, an #N/A error is returned.

=XLOOKUP(F2, $B$2:$B$6, $C$2:$C$6)
Exact match XLOOKUP

To get the grades instead of #N/A errors, we need to look for an approximate match as shown in the next example.

Approximate match XLOOKUP

To perform an approximate lookup, set the match_mode argument to either -1 or 1, depending on how your data is organized.

In our case, the lookup table lists the lower bounds of the grades. So, we set match_mode to -1 to search for the next smaller value when an exact match is not found:

=XLOOKUP(F11, $B$11:$B$15, $C$11:$C$15, ,-1)

For example, Brian has the score of 98 (F2). The formula searches for this lookup value in B2:B6 but cannot find it. Then, it searches for the next smaller item and finds 90, which corresponds to grade A:
Approximate match XLOOKUP to return the next smaller value

If our lookup table contained the upper bounds of the grades, we would set match_mode to 1 to search for the next larger item if an exact match fails:

=XLOOKUP(F2, $B$2:$B$6, $C$2:$C$6, ,1)

The formula searches for 98 and again cannot find it. This time, it tries to find the next larger value and gets 100, corresponding to grade A:
Approximate match XLOOKUP to return the next larger value

Tip. When copying an Xlookup formula to multiple cells, lock the lookup or return ranges with absolute cell references (like $B$2:$B$6) to prevent them from changing.

XLOOKUP with partial match (wildcards)

To perform a partial match lookup, set the match_mode argument to 2, which instructs the XLOOKUP function to process the wildcard characters:

  • An asterisk (*) - represents any sequence of characters.
  • A question mark (?) - represents any single character.

To see how it works, please consider the following example. In column A, you have a few smartphone models and, in column B, their battery capacity. You are curious about the battery of a certain smartphone. The problem is that you are not sure you can type the model name exactly as it appears in column A. To overcome this, enter the part that is definitely there and replace the remaining characters with wildcards.

For example, to get information about the battery of iPhone X, use this formula:

=XLOOKUP("*iphone X*", A2:A8, B2:B8, ,2)

Or, input the known part of the lookup value in some cell and concatenate the cell reference with the wildcard characters:

=XLOOKUP("*"&E1&"*", A2:A8, B2:B8, ,2)
XLOOKUP with wildcard match

XLOOKUP in reverse order to get last occurrence

In case your table contains several occurrences of the lookup value, you may sometimes need to return the last match. To have it done, configure your Xlookup formula to search in reverse order.

The direction of search is controlled be the 6th argument named search_mode:

  • 1 or omitted (default) - searches from first to last value, i.e. top-to-bottom with vertical lookup or left-to-right with horizontal lookup.
  • -1 - searches in reverse order from last to first value.

As an example, let's return the last sale made by a specific salesperson. For this, we put together the first three required arguments (G1 for lookup_value, B2:B9 for lookup_array, and D2:D9 for return_array) and put -1 in the 5th argument:

=XLOOKUP(G1, B2:B9, D2:D9, , ,-1)

Straightforward and easy, isn't it?
XLOOKUP in reverse order to get the last match

XLOOKUP to return multiple columns or rows

One more amazing feature of XLOOKUP is its ability to return more than one value relating to the same match. All is done with the standard syntax and without any extra manipulations!

From the below table, supposing you want to retrieve all the details pertaining to the salesperson in F2. What you need to do is supply a range containing several columns (B2:D7) for the return_array argument:

=XLOOKUP(F2, A2:A7, B2:D7)

You enter the formula in the top-left cell of the results range, and Excel automatically spills the results into adjacent blank cells. In our case, the returned array (G2:I2) consists of 1 row and 3 columns (Date, Item and Amount). Looking from another angle, we can say that XLOOKUP returns an entire row of data relating to the lookup value.
XLOOKUP to return multiple columns

If you prefer to arrange the results vertically in a column, nest XLOOKUP into the TRANSPOSE function to flip the returned array:

=TRANSPOSE(XLOOKUP(G1, A2:A7, B2:D7))
XLOOKUP to return multiple values in a column.

To return values from non-adjacent columns, nest the FILTER function in the return_array of XLOOKUP. A horizontal array {1,0,1} served to the include argument of FILTER determines which columns to filter out (0s) and which to return (1s).

=XLOOKUP(F2, A2:A7, FILTER(B2:D7, {1,0,1}))
XLOOKUP to return non-adjacent columns.

It should be noted, however, that XLOOKUP cannot return multiple columns when the lookup_value argument is a range. In this case, you can use the combination of the CHOOSEROWS and XMATCH functions:

=CHOOSEROWS(B2:C10, XMATCH(E2:E4, A2:A10))

Return multiple columns when the lookup value is a range.

Similarly, you can return values from multiple rows when performing a horizontal lookup. To put it differently, you can return an entire column of data relating to your lookup value.

For example, to return all the values from the Amount column, use "Amount" (F1) as lookup_value, the range A1:D1 containing the column headers as lookup_array, and the range A2:D7 as return_array.

=XLOOKUP(F1, A1:D1, A2:D7)
XLOOKUP to return entire column

It’s important to ensure that you have enough blank cells to the right or down when using XLOOKUP to return multiple values, as a #SPILL! error will occur if there are not enough empty cells.

Note. If your lookup array contains multiple occurrences of the lookup value and you aim to return all matches, XLOOKUP cannot do that. In this case, you can use the FILTER function or the combination of INDEX, SMALL and ROW functions as demonstrated in this tutorial: How to Vlookup multiple matches in Excel.

Tip. XLOOKUP can also be used to search for and replace values with other values that you specify. A example of such bulk replace can be found here: How to search and replace multiple values with XLOOKUP.

XLOOKUP with multiple criteria

Another big advantage of XLOOKUP is that it handles arrays natively. Due to this ability, you can evaluate multiple criteria directly in the lookup_array argument:

XLOOKUP(1, (criteria_range1=criteria1) * (criteria_range2=criteria2) * (…), return_array)

How this formula works: The result of each criteria test is an array of TRUE and FALSE values. The multiplication of the arrays converts TRUE and FALSE into 1 and 0, respectively, and produces the final lookup array. As you know, multiplying by 0 always gives zero, so in the lookup array, only the items that meet all the criteria are represented by 1. And because our lookup value is "1", Excel takes the first "1" in lookup_array (first match) and returns the value from return_array in the same position.

To see the formula in action, let's pull an amount from D2:D10 (return_array) with the following conditions:

  • Criteria1 (date) = G1
  • Criteria2 (salesperson) = G2
  • Criteria3 (item) = G3

With dates in A2:A10 (criteria_range1), salesperson names in B2:B10 (criteria_range2) and items in C2:C10 (criteria_range3), the formula takes this shape:

=XLOOKUP(1, (B2:B10=G1) * (A2:A10=G2) * (C2:C10=G3), D2:D10)

Though the Excel XLOOKUP function processes arrays, it works as a regular formula and is completed with a usual Enter keystroke.
XLOOKUP with multiple criteria

The XLOOKUP formula with multiple criteria is not limited to "equal to" conditions. You are free to use other logical operators as well. For example, to filter orders made on the date in G1 or earlier, put "<=G1" in the first criterion:

=XLOOKUP(1, (A2:A10<=G1) * (B2:B10=G2) * (C2:C10=G3), D2:D10)

For more examples, please see How to use XLOOKUP multiple criteria.

Double / nested XLOOKUP

To find a value at the intersection of a certain row and column, perform the so-called double lookup or matrix lookup. Yep, Excel XLOOKUP can do that too! You simply nest one function inside another:

XLOOKUP(lookup_value1, lookup_array1, XLOOKUP(lookup_value2, lookup_array2, data_values))

How this formula works: The formula is based on XLOOKUP's ability to return an entire row or column. The inner function searches for its lookup value and returns a column or row of related data. That array goes to the outer function as the return_array.

For this example, we are going to find the sales made by a particular salesperson within a certain quarter. For this, we enter the lookup values in H1 (salesperson name) and H2 (quarter), and do a two-way Xlookup with the following formula:

=XLOOKUP(H1, A2:A6, XLOOKUP(H2, B1:E1, B2:E6))

Or the other way round:

=XLOOKUP(H2, B1:E1, XLOOKUP(H1, A2:A6, B2:E6))

Where A2:A6 are the salesperson names, B1:E1 are quarters (column headers), and B2:E6 are data values.
Two-way XLOOKUP

A two-way lookup can also be performed with an INDEX Match formula and in a few other ways. For more information, please see Two-way lookup in Excel.

If Error XLOOKUP

When the lookup value is not found, Excel XLOOKUP returns an #N/A error. Quite familiar and understandable to expert users, it might be rather confusing for novices. To replace the standard error notation with a user-friendly message, type your own text into the 4th argument named if_not_found.

Back to the very first example discussed in this tutorial. If someone inputs an invalid ocean name in E1, the following formula will explicitly tell them that "No match is found":

=XLOOKUP(E1, A2:A6, B2:B6, "No match is found")
If Error XLOOKUP

Notes:

  • The if_not_found argument traps only #N/A errors, not all errors.
  • #N/A errors can also be handled with IFNA and VLOOKUP, but the syntax is a bit more complex and a formula is lengthier.

Case-sensitive XLOOKUP

By default, the XLOOKUP function treats lowercase and uppercase letters as the same characters. To make it case-sensitive, use the EXACT function for the lookup_array argument:

XLOOKUP(TRUE, EXACT(lookup_value, lookup_array), return_array)

How this formula works: The EXACT function compares the lookup value against each value in lookup array and returns TRUE if they are exactly the same including the letter case, FALSE otherwise. This array of logical values goes to the lookup_array argument of XLOOKUP. As the result, XLOOKUP searches for the TRUE value in the above array and returns a match from the return array.

For example, to get the price from B2:B7 (return_array) for the item in E1 (lookup_value), the formula in E2 is:

=XLOOKUP(TRUE, EXACT(E1, A2:A7), B2:B7, "Not found")
Case-sensitive XLOOKUP

Note. If there are two or more exactly the same values in the lookup array (including the letter case), the first found match is returned.

Excel XLOOKUP not working

If your formula does not work right or results in error, most likely it's because of the following reasons:

XLOOKUP is not available in my Excel

The XLOOKUP function is not backward compatible. It's only available in Excel for Microsoft 365 and Excel 2021, and won't appear in earlier versions.

XLOOKUP returns wrong result

If your obviously correct Xlookup formula returns a wrong value, chances are that the lookup or return range "shifted" when the formula was copied down or across. To prevent this from happening, be sure to always lock both ranges with absolute cell references (like $A$2:$A$10).

XLOOKUP returns #N/A error

An #N/A error just means the lookup value is not found. To fix this, try searching for approximate match or inform your users that no match is found.

XLOOKUP returns #VALUE error

A #VALUE! error occurs if the lookup and return arrays have incompatible dimensions. For instance, it is not possible to search in a horizontal array and return values from a vertical array.

XLOOKUP returns #REF error

A #REF! error is thrown when looking up between two different workbooks, one of which is closed. To fix the error, simply open both files.

As you have just seen, XLOOKUP has many awesome features that make it THE function for almost any lookup in Excel. I thank you for reading and hope to see you on our blog next week!

Practice workbook for download

Excel XLOOKUP formula examples (.xlsx file)

160 comments

  1. Hello,
    I was particularly interested in the above section on "XLOOKUP to return multiple columns or rows".

    Can you tell me, is the return array limited to adjacent columns (as your example per B2:D7 returns information from columns B, C and D.)?

    Or is it possible to return information from a table which has many columns but you only want info from for example B, F, K?

    Thanks, Janek

      • Thank you, that is almost perfect for what I need, though I think I see that when CHOOSECOLS is used, the XLOOKUP lookup value must be a single cell address and not an array itself.

  2. IN the double formula, do I have to use column and row at a time or i can use column and column or row & row? please help me to figure out this problem

  3. I am trying to figure out if the content of the cells needs to be text or number. i am comparing data from two speadsheets. the last 4 # of telephone #. I use the =RIGHT(cell location, 4) the result is the last 4 #'s of the 10 digit phone #. THe problem is when I am using the xlookup forumla Keep getting an #VALUE! error, I tried to convert both columns to numbers, but I am still gettin the error.

    • Hi! Unfortunately, I can't see your data and I don't know what formula you used. The LEFT function always returns text. If you convert those 4 digits to a number, you might lose the leading zeros. Note the paragraph above: XLOOKUP with wildcards. Here is an example formula:

      =XLOOKUP("*"&RIGHT(E1,4),C1:C12,A1:A12,,2)

      Pay attention to Match_mode: 2 - wildcard character match.
      I hope it’ll be helpful.

  4. I am trying to work out this formula =IF(A2>0, "Non Compliance","Compliance") but I want to exclude blank cells. How can I do that?

  5. Can a nested Xlookup return a result based on criteria in two different columns? I noticed that the most successful results are when there is one horizontal and one vertical.

  6. Hello,

    I am wondering if it's possible to have a multiple results but from the same column.

    For example I have value X that I am trying to find in column ''Y'' and than return the value from column ''Z'' next to it. This is pretty standard.

    But X appears a few times in ''Y'' with different value in ''Z'' - and I want the formula to return all those different values. Is it possible?

      • Hello!

        The instruction that you linked is exactly what I need (this section: Vlookup to return multiple results in one cell (comma or otherwise separated)).

        My issue is that the values I want returned are on the left side of the cell with the looked up value - that's why I was wondering if it's possible to do something like that with xlookup since here we don't have to worry about that.

        • Hi!
          I don't think you opened the article I recommended. Do that and see that the VLOOKUP function is not used and the order of the columns is irrelevant.

  7. Thanks for the great article. Wondering if you can suggest if it is useful for my situation below:
    I am trying to categorize purchases from my credit card bill. The entries look something like this:
    A B
    MARKS&SPENCER LONDON $100
    ITUNES 1234 $0.99
    TESCO PAY AT PUMP LIVERPOOL $97.00
    MARKS&SPENCER GATESHEAD $15.00
    ITUNES 0987 $0.99

    Column C should classify each item into a category (eg Supermarket, iTunes or Petrol) based on the content of Column A. I am currently using a IFS(ISNUMBER(SEARCH formula to check column A for partial text (i.e. "MARKS&SPENCER") and return a category but the formula has become very long. Can this be done using an array instead?

    • Hello!
      Use the SEARCH function to determine partial matching of text strings.

      =INDEX($E$1:$E$5,MATCH(TRUE,ISNUMBER(SEARCH($E$1:$E$5,A2)),0))

      Use INDEX MATCH to get the desired value from the list of categories $E$1:$E$5. I hope it’ll be helpful. If something is still unclear, please feel free to ask.

      • Thank you Alexander, that got the job done

        Cheers

  8. I am using a XLOOKUP in order to sort and match results between two tables based on a unique ID number.

    the formula I am using looks like this: =XLOOKUP(A2,LiveProjects!M:M,LiveProjects!P:P,"",0,1)

    This seems to be working only for SOME of the IDs i have in the table I am using, but not all. Does this not work if you are searching using a value in A2 which is the result of another formula?

    I.e. does the look up only look in the text in the cell and not the result given by that text?

  9. How do I get a return of multiple column headers by matching a repeated row value using Xlookup? Ex. Column headers are different shopping centers and rows are different items. I am trying to look up a specific item (row) and the return to be a list of column headers (shopping centers) that sell the item. Thank you

  10. Hi - this is the best tutorial I've come across. Thanks

    1- I have two Sheets (LISTING= with columns: Vendor Name, ID# and Hotel; & HOTEL= with 9 columns that contain the first 3 cols as: Priority Vendor1, ID# & Email ; Priority Vendor2, ID# & Email; and Priority Vendor3, ID# & Email

    2- I need to return the vendor name found on either one of the Priority Vendor1, 2 or 3 cols based on the ID# on the LISTING sheet, but I haven't been able to get results by doing a search of the ID# on (sheet1) on the 3 cols of sheet2

    Is this possible?

  11. I am comparing 2 columns. The first column has 16318 rows and the second 18526 rows. The formula =XLOOKUP(C2, B2:B18584, A2:A18584, "No match is found") works perfectly.

    My question: Is there a way to populate the formula in column "D" incrementing the C2 value without changing the range values? When I use ctl and pull the corner of the cell down to copy into subsequent cells the first cell value of the ranges also increments resulting the elimination of one cell for every copy.

    Example: =XLOOKUP(C61, B61:B18584, A61:A18584, "No match is found")
    Thanks for your insight.

  12. Is XLookup able to return the first result that has a negative number?

  13. Is there a way to use xlookup (or maybe it would be something else) to return one value from two. To explain I have a table in document 1 that has included in it first names (column c) and last names (column B) and I want it to find and input the ID number (column A) from document 2. Document 2 has all of the above information and other information that I don't need, all in separate columns. So I need it to get a match to both first and last name for it to get the ID number. Unfortunately, the way it is set up, I cannot do the inverse and input the ID numbers and search for the first and last names. Is there a way to do this? Another option is I can have it in document 1 as LastName, First Name in column B and ID number in column A, but document 2 would still have the last name and first name separate.

    Thanks in advance!!

    • Hello!
      You can search by two criteria with INDEX+MATCH or XLOOKUP. See formula examples here.
      To input the ID numbers and search for the first and last names, you can use the paragraph in this article above: XLOOKUP to return multiple columns or rows.
      I hope I answered your question. If something is still unclear, please feel free to ask.

  14. I'm trying build out an excel file using two sheets. I'm trying to use the ID# from column A sheet one to find said ID# from sheet two. Then I'd like it to search for the row title from sheet 1 on sheet 2 to pull sheets 2s value into sheet 1. Is this possible?

  15. How would you use the function of xlookup in excel? And what was the function names before as?

    Someone can answer this please. Thanks in advance ?

  16. Hi! I'm trying to use XLOOKUP for the following situation but I don't know how to do so the number of cals finds the right pricing tier.
    I have 1 table with 14 columns: a) a CONCAT formula to add in 1column the centre, market & channel info (BsAsARGcall) b) different pricing tiers, under 4000 calls there's a price for each centre, market & channel and the same for every tier: over 8000, over 10000 calls, etc there's a different price according to amount of contacts
    In another table I have a column with another CONCAT formula same info as above (centre, market,channel) and then the column with amount of calls per centre, market, channel.
    What I need to do is for the XLOOKUP to find the right price by searching the right tier column (under 4000, over 8000, etc) and bring the right price according to the amount of calls. Any help? Hope I was able to explain myself clearly :-)

  17. Hi,
    I need to retrieve data under certain conditions from one sheet to another, and here is the formula I am using: =XLOOKUP((IF(OR('by sample'!$H4="cheek, right",'by sample'!$H4="cheek, left"),'by sample'!$H4,"")),'by sample'!$H4:$H1000,'by sample'!B4:B1000,,0).
    It works well, but when the results is N/A I would like excel to find the next xlookup value.
    I am trying to write an IFNA of the sort: IFNA(XLOOKUP(...), find next xlookup value) to avoid removing the cells manually/with find and select tool, but without success...
    How could I proceed?

  18. HI,
    I am trying to copy down the XLOOKUP function to use it for an entire column but it is changing the search array.
    EXP.
    XLOOKUP(B1, C2:C6, D3:D7) then when I copy down I want XLOOKUP(B2, C2:C6, D3:D7) but I get XLOOKUP(B2, C3:C7, D4:D8). It shifts all by 1 cell instead of just the search value.

    How do I get it to automatically shift the search but not the other 2 array?

    Thanks

  19. Hello - has this replaced the use of Transpose and Filter? I used to use this formula to look up an array that had multiple instances and returns in one column: "=TRANSPOSE(FILTER(C2:C6, B9=B2:B6))". Where C2:C6 had the expected outputs (more than one output but only in one column) B9 is the criteria to lookup and B2;B6 is the array to look for it in.
    When I use it now I need a NAME error which seems to indicate its no longer a recognized formula name.
    I cant find the equivalent in the xlookup formula i.e. where the multiple responses are all in the same column.

  20. Very informative, thank you. I was particularly interested in XLOOKUP with multiple criteria. You use:

    XLOOKUP(1, (criteria_range1=criteria1) * (criteria_range2=criteria2) , return_array)

    I had not seen this before, and previously I had used concatenation, for example:

    XLOOKUP(criteria1 & criteria2, criteria_range1 & criteria_range2, return_array)

    But this can be very slow if you are referencing whole columns. Do you know if your approach is faster? I suspect it would be.

    • Hello!
      I do not recommend using the entire column as criteria_range (for example, A:A). This will slow down the calculations significantly. Use the range where the data is actually located (for example, A2:A100).

      • Thanks Alexander. Yes I appreciate that using specific ranges is faster than entire columns. In some models though I find column references are preferable, as the formulas are easier to read and you don't have to worry about users adding new data to rows outside the range.

        I guess my question is, *for a given range of data*, whether there is a significant difference in speed between the two XLOOKUP approaches above. I might have a play around to see.

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)