XLOOKUP Google Sheets function

The XLOOKUP function in Google Sheets is a versatile tool designed for searching a range of values and returning corresponding data from another range. It replaces older functions like VLOOKUP and HLOOKUP, providing additional features such as reverse search and exact match options. This function streamlines data retrieval, making it easier and more efficient to manage and analyze information.

Syntax

XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
  • lookup_value: The value you want to search for within the lookup_array.
  • lookup_array: The range of cells containing the values you want to search through.
  • return_array: The range of cells that contain the data you want to retrieve.
  • if_not_found: Optional. The value to return if no matches are found.
  • match_mode: Optional. Defines how to match the lookup_value to the values in the lookup_array (exact match, exact match or next smaller, etc.).
  • search_mode: Optional. Specifies the order to search: from first to last or last to first.

Example #1

XLOOKUP("Apple", A2:A5, B2:B5)
This function looks for “Apple” in the range A2:A5 and returns the corresponding value from B2:B5. For instance, if “Apple” is in A3 and the value in B3 is 10, the result would be 10.

Example #2

XLOOKUP("Banana", A2:A5, B2:B5, "Not Found")
This function searches for “Banana” in the range A2:A5. If “Banana” is absent, it will return “Not Found”. If found at A4 with a corresponding value of 15 in B4, the result would be 15.

Example #3

XLOOKUP("Peach", A2:A5, B2:B5, "Not Found", 2)
This function looks for “Peach” in the range A2:A5, returning the next smaller match. If “Peach” is absent but “Orange” (with a value in B5 of 5) is smaller, then the result would be 5.

Error handling

  • N/A: Indicates that the lookup_value was not found in the lookup_array.
  • VALUE!: Occurs if the lookup_array or return_array dimensions do not match.
  • NAME?: Happens if XLOOKUP is misspelled or not recognized as a function.

Conclusion

In summary, the XLOOKUP function enhances data handling in Google Sheets by providing an efficient means to search for and retrieve corresponding values. Its versatility, combined with the ability to manage mismatches and custom error messages, makes it an indispensable tool for anyone dealing with data analytics. Whether you’re tracking sales figures or analyzing customer data, mastering XLOOKUP will significantly streamline your workflow.

Leave a Reply

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