VLOOKUP vs XLOOKUP in Google Sheets: Complete Guide

Google Sheets
/
October 27, 2023

Introduction

For the Google Sheets tip of this week we are going to look at 2 powerful functions: VLOOKUP and XLOOKUP. These two are “non-identical twins”, meaning that they both allow you to lookup data, but in different ways and use cases. 

When it comes to data integration, many users grapple with challenges, and lookups functions are often the go-to solution to address them. This article is your guide to understanding the key differences between VLOOKUP and XLOOKUP, helping you build solid skills to address your data challenges.

Did you know?

Dokin allows you to build dashboards with real-time data from your systems, including your CRM, Marketing platforms and more.

Build insightful reports in seconds and automate your reporting.

Try for free

What is VLOOKUP in Google Sheets?

Let's begin with a brief overview of VLOOKUP, a function that has been a staple in Google Sheets for a long time. VLOOKUP, which stands for "Vertical Lookup," is a powerful function used to search for a value in the leftmost column within a range and return a related value from a corresponding column.

Example: Suppose you have a spreadsheet with Payroll information, and you want to find the salary figure for a specific Employee name. VLOOKUP enables you to perform this task efficiently.

As the Employee name is on column C, which is on the left of the salary column, you can use the VLOOKUP to return the salary value in my I8 cell.

The formula is going to be:

VLOOKUP(search_key, range, index, [is_sorted])

Where: 

  • search_key is the value you want to find (in this case the Employee Name in cell H8).
  • range refers to the array containing your lookup value. Your lookup column will be the leftmost one of this range
  • index is the index number of the column that contains the corresponding return value. In this case, column number 3 of our array.
  • [is_sorted] finally we need to explicit wheter we are looking for an exact match (FALSE) or we accept an approximate one (TRUE)

While VLOOKUP is a reliable tool, as you can see it has some limitations.

What is XLOOKUP in Google Sheets?

Now, let's meet the newcomer: XLOOKUP. XLOOKUP is a more versatile and modern function that enhances data integration in Google Sheets. Introduced in Excel in 2019 and subsequently integrated into Google Sheets in August 2022, XLOOKUP is the go-to choice for users seeking a dynamic and adaptable lookup function.

Example: Let’s take the same example as above. Only this time we want to look up salaries, not based on the employee name but their ID, as we want to protect their privacy. VLOOKUP can’t help us in this case, as the ID column comes after the salary one. That’s when the XLOOKUP comes to our rescue:

As you can see, XLOOKUP allows us to achieve that because it is more flexible. It allows us to select a custom lookup array, which can be horizontal or vertical as well as a custom return array.

Let’s see it in more detail.

What is the XLOOKUP function in Google Sheets?

To understand XLOOKUP fully, let's break down its syntax:

=XLOOKUP(search_key, lookup_range, result_range, [missing_value], [match_mode], [search_mode])

This function includes three required and three optional arguments, each with specific purposes:

Required arguments:

  • search_key is the value you want to find.
  • lookup_range refers to the array containing your lookup value.
  • result_range is the array that contains the corresponding return value.

Optional arguments:

  • [missing_value] is returned when the lookup value isn't found. The formula returns an #N/A error if you don't specify this argument.
  • [match_mode] allows you to specify your preferred type of match, such as exact, next smallest, or next largest match, or even partial matching using wildcard characters.
  • [search_mode] defines how the XLOOKUP function should find the value in the lookup array, allowing for top-to-bottom, bottom-to-top, and binary search options.

Should you use XLOOKUP instead of VLOOKUP?

It depends. As I mentioned in my Youtube video, XLOOKUP is not just a novelty; it's a powerful tool that can significantly enhance your data integration in Google Sheets. It goes beyond the limitations of VLOOKUPS. Consider adopting XLOOKUP in the following scenarios:

  • Exact and Approximate Matching: XLOOKUP supports both exact and approximate matching, offering flexibility in various data scenarios.
  • Vertical and Horizontal Ranges: Unlike VLOOKUP, XLOOKUP can perform lookups in both vertical and horizontal ranges, making it adaptable to different spreadsheet layouts.
  • Wildcards for Partial Matching: XLOOKUP allows you to use wildcards like asterisks (*) or tildes (~) for partial matching, enhancing search capabilities.

What is the difference between VLOOKUP and XLOOKUP in Google Sheets?

Let's now compare VLOOKUP and XLOOKUP to understand their fundamental differences.

  • Function Versatility: XLOOKUP is more versatile than VLOOKUP. While VLOOKUP can only lookup values in the leftmost column of a range, XLOOKUP is not bound by that. It can handle a wider range of data integration scenarios and has a more robust set of capabilities.
  • Exact Matching: While VLOOKUP requires the inclusion of FALSE as the last parameter for exact matching, XLOOKUP handles exact matches by default.
  • Handling Missing Values: XLOOKUP makes it easy to specify a value to return when there is no match, which is cumbersome in VLOOKUP.
  • Wildcard Searches: XLOOKUP allows for wildcard searches, which can be immensely helpful in scenarios where you only know parts of a value.

The Benefits of Using XLOOKUP

XLOOKUP brings several advantages to the table, making it the preferred choice for data integration:

  • Default Exact Matches: XLOOKUP can find exact matches by default, eliminating the need for cumbersome adjustments.
  • Handling Missing Values: You can easily specify a value to return when there's no match, reducing potential errors.
  • Optional Parameters: XLOOKUP includes optional parameters for advanced searches, such as wildcard searches.
  • Multiple Directions: Unlike VLOOKUP's limitations, XLOOKUP can search in any direction, offering more flexibility.
  • Return Multiple Values: You can retrieve multiple values using XLOOKUP, simplifying complex data retrieval tasks.
  • Search with Multiple Criteria: XLOOKUP handles arrays natively, enabling searches with multiple criteria.
  • Column Management: XLOOKUP adapts to column changes without breaking formulas.

With these benefits, XLOOKUP proves its worth as a powerful tool for data integration. However, there are alternatives to XLOOKUP that you can explore:

XLOOKUP Alternatives in Google Sheets

  • XLOOKUP with INDEX MATCH: You can combine the INDEX and MATCH functions to simulate XLOOKUP's functionality.
  • XLOOKUP with FILTER Function: The FILTER function can replicate XLOOKUP's capabilities with a simple syntax.
  • XLOOKUP with VLOOKUP: Although not as flexible as XLOOKUP, you can leverage VLOOKUP for basic lookup needs.
  • XLOOKUP with QUERY Function: The QUERY function allows you to perform complex lookups but is more advanced.

Conclusion

In conclusion, when it comes to data integration in Google Sheets, the choice between VLOOKUP and XLOOKUP is clear. XLOOKUP's versatility and advanced capabilities make it a worthy successor to VLOOKUP. Plus, when you pair XLOOKUP with Dokin’s live data integrations, you unlock a powerful synergy that can take your dashboards and reporting to the next level.

Don't miss out on the advantages of XLOOKUP and the efficiency of Dokin. Embrace the future of data integration in Google Sheets and experience the difference for yourself.

Enjoyed this article?

Check out our blog or our help center for more.
Dokin, the data platform of modern business teams
Try for free

Jacopo Proietti

Co-founder @Dokin
Jacopo, a co-founder of Dokin, boasts 8 years in finance, having worked as a finance manager at Ogury and head of Financial Planning and Control at BlaBlaCar.
His passion for data integration led to the creation of Dokin, a game-changer for modern business teams. With customizable templates and built-in data connections, Dokin allows modern CMOs and CFOs to streamlines data reporting across Google Workspace applications.

More Stories

Marketing Data
Productivity tips
Google Sheets
Growth Loops vs. AARRR Funnels: What’s the difference and How To Choose (2024)
Marketing Data
Marketing Mix Modeling - What is it and How To Use it
Marketing Data
Google Sheets
Search Ads vs. Display Ads: Which one is right for you?