VLOOKUP and XLOOKUP are two functions in Excel that are used to look up and retrieve data from a table. While VLOOKUP has been a popular function for many years, XLOOKUP is a newer function that was introduced in Excel 365. In this article, we will compare VLOOKUP vs. XLOOKUP, including the benefits and drawbacks of each function, and provide three examples that show the data used and the result.

VLOOKUP

VLOOKUP is a function that is used to look up a value in a table and return a corresponding value from the same row. The V in VLOOKUP stands for vertical, as the function looks up the value in a vertical column. The syntax for VLOOKUP is as follows:

=VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)

Benefits of VLOOKUP:

1. Simplicity: VLOOKUP is a simple function that is easy to use and understand.
2. Widely used: VLOOKUP has been a popular function in Excel for many years and is widely used in the industry.
3. Stable: VLOOKUP has been around for a long time and is a stable function that is unlikely to change or be removed from Excel.

Drawbacks of VLOOKUP:

1. Limited functionality: VLOOKUP can only look up values in the leftmost column of a table and return a corresponding value from the same row. This means that it cannot be used to look up values to the right of the lookup column.
2. Exact match requirement: VLOOKUP requires an exact match between the lookup value and the value in the lookup column. This can make it difficult to use when dealing with data that contains variations or typos.
3. Slow performance: VLOOKUP can be slow to calculate, especially when used with large data sets.

Examples of VLOOKUP:

### Example 1: Looking up a Value in a Table

Suppose you have a list of products and their prices. You want to look up the price of a particular product.

To look up the price of product B, you can use the following formula:

=VLOOKUP(“B”,A2:B5,2,FALSE)

This formula looks up the value “B” in the range A2:B5 and returns the corresponding value from the second column. The result will be as follows:

### Example 2: Looking up a Value and Returning a Default Value

Suppose you have a list of products and their prices. You want to look up the price of a particular product, but you want to return a default value if the product is not found.

To look up the price of product E and return a default value if the product is not found, you can use the following formula:

This formula looks up the value “E” in the range A2:B5 and returns the corresponding value from the second column. If the value is not found, the formula returns the message “Product not found.” The result will be as follows:

### Example 3: Looking up Values from a Different Sheet

Suppose you have a list of products and their prices on Sheet1, and you want to look up the prices on Sheet2.

Sheet1:

Sheet2:

To look up the prices on Sheet2, you can use the following formula:

=VLOOKUP(A2,Sheet1!\$A\$2:\$B\$5,2,FALSE)

This formula looks up the value in cell A2 on Sheet2 in the range A2:B5 on Sheet1 and returns the corresponding value from the second column. The result will be as follows:

Sheet2:

XLOOKUP

XLOOKUP is a newer function in Excel that was introduced in Excel 365. XLOOKUP is a more versatile function than VLOOKUP and can perform more complex lookups. The syntax for XLOOKUP is as follows:

=XLOOKUP(lookup_value,lookup_array,result_array,[if_not_found],[match_mode],[search_mode])

Benefits of XLOOKUP:

1. Versatility: XLOOKUP can perform a wide range of lookups, including looking up values to the left of the lookup column, returning multiple results, and returning the nth match.
2. Simplicity: XLOOKUP is a simple function that is easy to use and understand.
3. Dynamic arrays: XLOOKUP can return dynamic arrays, which means that it can return multiple results that automatically adjust as the data changes.

Drawbacks of XLOOKUP:

1. Limited compatibility: XLOOKUP is only available in Excel 365, which means that it is not available in earlier versions of Excel.
2. Complexity: While XLOOKUP is a more versatile function than VLOOKUP, it is also more complex, which can make it more difficult to use and understand.
3. Performance: XLOOKUP can be slower to calculate than VLOOKUP, especially when used with large data sets.

Examples of XLOOKUP:

### Example 1: Looking up a Value in a Table

Suppose you have a list of products and their prices. You want to look up the price of a particular product.

To look up the price of product B, you can use the following formula:

=XLOOKUP(“B”,A2:A5,B2:B5)

This formula looks up the value “B” in the range A2:A5 and returns the corresponding value from the range B2:B5. The result will be as follows:

### Example 2: Looking up a Value and Returning a Default Value

Suppose you have a list of products and their prices. You want to look up the price of a particular product, but you want to return a default value if the product is not found.

To look up the price of product E and return a default value if the product is not found, you can use the following formula:

This formula looks up the value “E” in the range A2:A5 and returns the corresponding value from the range B2:B5. If the value is not found, the formula returns the message “Product not found.” The result will be as follows:

### Example 3: Looking up Values to the Left of the Lookup Column

Suppose you have a list of products and their prices, and you want to look up the product name based on the price.

To look up the product name for a price of 30, you can use the following formula:

=XLOOKUP(30,B2:B5,A2:A5)

This formula looks up the value 30 in the range B2:B5 and returns the corresponding value from the range A2:A5. The result will be as follows:

### Example 4: Returning Multiple Results

Suppose you have a list of products and their prices, and you want to look up all the products with a price greater than or equal to 20.

To return all the products with a price greater than or equal to 20, you can use the following formula:

=XLOOKUP({1,2,3,4},{1,2,3,4},A2:A5,,1,1)*(B2:B5>=20)

This formula returns a dynamic array of values that match the criteria. The result will be as follows:

### Example 5: Returning the Nth Match

Suppose you have a list of products and their prices, and you want to look up the second occurrence of a product.

To look up the second occurrence of product C, you can use the following formula:

=XLOOKUP(“C”,A2:A5,B2:B5,,2)

This formula looks up the value “C” in the range A2:A5 and returns the second corresponding value from the range B2:B5. The result will be as follows:

Conclusion

Both VLOOKUP and XLOOKUP are powerful functions in Excel that can be used to look up and retrieve data from a table. While VLOOKUP is a more straightforward function that is widely used and stable, XLOOKUP is a more versatile function that can perform more complex lookups. By comparing the benefits and drawbacks of each function and examining examples of each, you can choose the function that best suits your needs and data requirements.