How to Use XLOOKUP in Excel - Learn Excel (2024)

Excel is a powerful tool with numerous functions and features that can help users process and manage data efficiently. One of the most useful functions is XLOOKUP, introduced in Excel 365. XLOOKUP, as the name suggests, helps you lookup and return values from a corresponding table or range. It offers significant improvements over its predecessor, VLOOKUP, and can handle a wide range of lookup scenarios more accurately and efficiently. In this blog post, we will guide you on how to use XLOOKUP in Excel, so you can take advantage of this function and make your work easier and faster.

1. Understanding the syntax of XLOOKUP

XLOOKUP is a versatile function that allows you to lookup and return values from a table or range. Its syntax is straightforward and intuitive, making it easy to use. The four parameters that you need to provide are:

Lookup_value:

This is the value that you want to look up in the table or range.

Lookup_array:

This is the range or array where you want to search for the lookup_value.

Return_array:

This is the range or array containing the values you want to return.

If_not_found:

This is the value or message that you want to return if the lookup_value is not found in the lookup_array.

2. Using XLOOKUP to search for exact matches

If you want to search for exact matches, you can use XLOOKUP with the exact match argument set to TRUE. Here’s how:

  1. Select the cell where you want to retrieve the lookup value.
  2. Type the XLOOKUP function with the following syntax: =XLOOKUP(lookup_value,lookup_array,return_array,0)
  3. Replace “lookup_value,” “lookup_array,” and “return_array” with the appropriate ranges or values.
  4. Press Enter, and the result will be displayed in the selected cell.

3. Using XLOOKUP to search for approximate matches

If you want to search for approximate matches, you can use XLOOKUP with the approximate match argument set to FALSE. Here’s how:

  1. Select the cell where you want to retrieve the lookup value.
  2. Type the XLOOKUP function with the following syntax: =XLOOKUP(lookup_value,lookup_array,return_array,1)
  3. Replace “lookup_value,” “lookup_array,” and “return_array” with the appropriate ranges or values.
  4. Press Enter, and the result will be displayed in the selected cell.

4. Using XLOOKUP with wildcards

If you want to use wildcards to search for a pattern, you can use XLOOKUP with the match mode argument set to 2. Here’s how:

  1. Select the cell where you want to retrieve the lookup value.
  2. Type the XLOOKUP function with the following syntax: =XLOOKUP(lookup_value&”*”,lookup_array& “*”, return_array,2)
  3. Replace “lookup_value,” “lookup_array,” and “return_array” with the appropriate ranges or values.
  4. Press Enter, and the result will be displayed in the selected cell.

5. Using XLOOKUP with multiple criteria

If you want to search for values based on multiple criteria, you can use XLOOKUP with the IF function. Here’s how:

  1. Select the cell where you want to retrieve the lookup value.
  2. Type the formula =XLOOKUP(1,(criteria1=lookup_array)*(criteria2=lookup_array)*(criteria3=lookup_array)*match_result,return_array)
  3. Replace “criteria1,” “criteria2,” “criteria3,” “lookup_array,” “match_result,” and “return_array” with the appropriate ranges or values.
  4. Press Enter, and the result will be displayed in the selected cell.

6. Using XLOOKUP vs. VLOOKUP

XLOOKUP is a recent addition to Excel, and it offers several advantages over VLOOKUP. Unlike VLOOKUP, XLOOKUP can perform left-to-right and right-to-left lookups. It also allows you to specify a range for the return values, which VLOOKUP doesn’t. XLOOKUP is also faster and more versatile, as it can handle more than one lookup criterion. If you already know how to use VLOOKUP, transitioning to XLOOKUP is easy.

7. Using XLOOKUP with dynamic arrays

XLOOKUP is designed to work with dynamic arrays in Excel 365. A dynamic array is a range of cells that automatically expands or contracts based on the data you enter. If you have Excel 365, you can use XLOOKUP with dynamic arrays to make your work more efficient. You can create a dynamic array by entering data in a table or by using the Filter function.

8. Troubleshooting XLOOKUP errors

XLOOKUP, like any Excel function, may return an error if there’s something wrong with the formula or the data. The most common errors are #N/A (Value not available), #REF (Invalid cell reference), and #NAME? (Invalid function name). If you encounter an error, check the formula and the data for errors or inconsistencies. Make sure that the ranges and criteria are correct.

9. XLOOKUP examples

Here are some examples of how to use XLOOKUP in Excel:

  • Retrieving a value from a table using an exact match: =XLOOKUP(B2,A2:A7,C2:C7,0)
  • Retrieving a value using an approximate match: =XLOOKUP(B2,A2:A7,C2:C7,1)
  • Retrieving a value using a wildcard: =XLOOKUP(B2&”*”,A2:A7,C2:C7,2)
  • Retrieving a value using multiple criteria: =XLOOKUP(1,(B2=lookup_range)*(C2=lookup_range)*match_value,return_range)

XLOOKUP is a versatile and powerful function in Excel that can help you search for and retrieve data more efficiently. It offers several advantages over VLOOKUP and is easy to use once you understand its syntax. By following the steps outlined in this guide, you can start using XLOOKUP in your worksheets and make your work more efficient and accurate.

FAQ

Here are some common questions about using XLOOKUP in Excel:

1. What is the difference between XLOOKUP and VLOOKUP?

XLOOKUP and VLOOKUP are both functions in Excel that allow you to look up and retrieve data from a table or range. However, XLOOKUP is more versatile and faster than VLOOKUP. XLOOKUP can handle left-to-right and right-to-left lookups, allows you to specify a range for the return values, and can handle more than one lookup criterion.

2. How do I troubleshoot XLOOKUP errors?

If you encounter an error with the XLOOKUP function, check the formula and the data for errors or inconsistencies. Make sure that the ranges and criteria are correct. The most common errors are #N/A (Value not available), #REF (Invalid cell reference), and #NAME? (Invalid function name).

3. Can I use XLOOKUP with dynamic arrays?

Yes, if you have Excel 365, you can use XLOOKUP with dynamic arrays to make your work more efficient. A dynamic array is a range of cells that automatically expands or contracts based on the data you enter. You can create a dynamic array by entering data in a table or by using the Filter function.

4. How do I use XLOOKUP with wildcards?

You can use XLOOKUP with wildcards to search for a pattern. To do this, use XLOOKUP with the match mode argument set to 2. Replace “lookup_value,” “lookup_array,” and “return_array” with the appropriate ranges or values, and include the “*” wildcard character in the lookup criteria.

5. Can XLOOKUP handle multiple criteria?

Yes, XLOOKUP can handle multiple criteria. If you want to search for values based on multiple criteria, you can use XLOOKUP with the IF function. Replace “criteria1,” “criteria2,” “criteria3,” “lookup_array,” “match_result,” and “return_array” with the appropriate ranges or values, and provide all the necessary lookup criteria.

How to Use XLOOKUP in Excel - Learn Excel (2024)

FAQs

How to Use XLOOKUP in Excel - Learn Excel? ›

To do this, type =XLOOKUP( in the ribbon bar. The next step is to insert your lookup criteria. This is the data you're looking to search for. While XLOOKUP supports numbers and text strings, most users will want to specify a cell reference (such as A2).

How do I use Xlookup vs VLOOKUP? ›

XLOOKUP can look for values to the left and right of the lookup array, while VLOOKUP is limited to only looking for values to the right of the lookup value column. XLOOKUP allows you to customize text when a valid match is not found, while VLOOKUP only shows you an #N/A (error sign).

How to use xlookup in Excel with two worksheets? ›

To use XLOOKUP between two sheets, start by defining the value you wish to look up (lookup_value). Then, specify the range of cells containing possible matches (lookup_array) on the second sheet. Lastly, indicate the range of cells (return_array) where the corresponding data is to be retrieved from.

How do you use Xlookup for multiple results? ›

One easy way of performing a multiple criteria lookup is by using XLOOKUP with the "&" operator that concatenates all the criteria into one lookup value and their corresponding lookup columns into one lookup array. This approach is more efficient than using VLOOKUP because you don't need the helper column.

How to use xlookup to find matching data? ›

For instance, in the formula =XLOOKUP(E3,A2:A10,D2:D10,”not found”,-1,1), Excel finds the exact match or next and smallest value matching the lookup value in cell E2 and returns it. With search_mode set as 1, Excel will search in ascending order, returning the first matching value in the range.

How to use xlookup formula in Excel? ›

Tip: You can also use XLOOKUP to replace the HLOOKUP function. Note: The formula in cells D3:F3 is: =XLOOKUP(D2,$B6:$B17,XLOOKUP($C3,$C5:$G5,$C6:$G17)). Example 6 uses the SUM function, and two nested XLOOKUP functions, to sum all the values between two ranges.

Which action cannot be made using xlookup? ›

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.

Can you use xlookup with two conditions? ›

XLOOKUP formula for multiple OR criteria in the same column

As a result, an XLOOKUP formula with the lookup value set to 1 effectively fetches the value for which any condition is true. Note. If there are two or more entries matching any of the conditions, the formula returns the first found match.

How many rows can XLOOKUP handle? ›

The Xlookup function doesn't have a limit. This means you can use all 1,048,576 rows and 16,384 columns of a workbook.

Can you do two xlookups in one formula? ›

Explanation. One of XLOOKUP's features is the ability to lookup and return an entire row or column. This feature can be used to nest one XLOOKUP inside another to perform a two-way lookup. The inner XLOOKUP returns a result to the outer XLOOKUP, which returns a final result.

How do you lookup in Excel with two criteria? ›

To perform an INDEX MATCH with multiple criteria in Excel, simply use an ampersand (&) to place multiple references in your lookup value and lookup array inputs in the MATCH formula.

Does xlookup require sorted data? ›

The traditional INDEX MATCH formula can find exact matches in any dataset as well as approximate matches (closest smaller or closest larger) but only if your data is sorted. XLOOKUP and INDEX XMATCH can do any matching on unsorted data, thanks to the inherent features.

Why is my xlookup not working? ›

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.

How to do VLOOKUP in Excel for dummies? ›

How to use VLOOKUP in Excel
  1. Step 1: Organize the data. ...
  2. Step 2: Tell the function what to lookup. ...
  3. Step 3: Tell the function where to look. ...
  4. Step 4: Tell Excel what column to output the data from. ...
  5. Step 5: Exact or approximate match.

How do you use VLOOKUP and if formula together? ›

Build the IF formula around the VLOOKUP formula:
  1. Enter IF( between the = and VLOOKUP formula. The formula looks like this: =IF(VLOOKUP(F4, B$4:D$7, 2, FALSE)
  2. Enter >0 right after the VLOOKUP formula. ...
  3. Enter "Yes", which defines if the Test value returns TRUE.
  4. Enter "No", which defines if the Test value returns FALSE.

Top Articles
Latest Posts
Article information

Author: Greg Kuvalis

Last Updated:

Views: 6000

Rating: 4.4 / 5 (75 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Greg Kuvalis

Birthday: 1996-12-20

Address: 53157 Trantow Inlet, Townemouth, FL 92564-0267

Phone: +68218650356656

Job: IT Representative

Hobby: Knitting, Amateur radio, Skiing, Running, Mountain biking, Slacklining, Electronics

Introduction: My name is Greg Kuvalis, I am a witty, spotless, beautiful, charming, delightful, thankful, beautiful person who loves writing and wants to share my knowledge and understanding with you.