Codementor Events

XLOOKUP In Excel

Published Jan 08, 2022
XLOOKUP In Excel

XLOOKUP is an updated version of VLOOKUP, HLOOKUP and other Lookup functions in excel.
XLOOKUP searches for a value in table or array of values.

Syntax of XLOOKUP as follows:

=XLOOKUP(lookup,lookup_array,return_array,[not_found],[match_mode],[search_mode])
  • lookup : The value which you want to lookup.
  • lookup_array : The range in which lookup value is present.
  • return_array : The range that contains the return value.
  • not_found : Optionally, you can specify the value to return if match not found.
  • match_mode : Optionally, you can specify 0(default) - exact match , -1 - exact or smaller , 1 - exact or larger.
  • search_mode : Optionally, you can specify 1 to search from top to bottom and-1 to search from bottom to top.

Basic XLOOKUP Function

Screenshot (59).png

Result is as follows:
Screenshot (60).png

Not found

Like, other Lookup functions in excel XLOOKUP also returns N/A error when it can't find a match.
Unlike, other Lookup functions XLOOKUP supports an optional argument named not found to give a message rather than a N/A error.
Note: when providing message, text must be enclosed in double quotes("")

Screenshot (67).png

Result is as follows:
Screenshot (68).png

Match Mode

By default, XLOOKUP will perform an exact match but we change match type by using match mode argument.There are following arguments in match mode :

0(default) - exact match
1 - exact or next larger item
-1 - exact or next smaller item.
2 - wildcard match(*,?,~)

Screenshot (69).png

Result is as follows:
Screenshot (70).png

Search Mode

By deafault,XLOOKUP work from top to bottom but you can also change its behaviour by search mode argument.

1(default) - top to bottom
-1 - bottom to top(reverse)

Screenshot (71).png

Result is as follows:
Screenshot (72).png

Note : XLOOKUP function works only on Excel365.

Discover and read more posts from anshika vohra
get started
post commentsBe the first to share your opinion
Show more replies