# XLOOKUP

The XLOOKUP function returns the value in the same row after finding a matching value in any column.
This looks up a value in any column of a table and returns a value in the same row but in a different column.
Alternatively it can look up a value in one row and return a value in the same column but in a different row.
This function is not case sensitive. ### Replaces VLOOKUP and HLOOKUP

This function replaces both VLOOKUP and HLOOKUP.
This function defaults to "exact match" and not "closest match or the next smallest".
This function still works after inserting or deleting columns (or rows).
This function can lookup values on the left of the lookup_value column.
This function can search from the bottom up without sorting.

### Return the Exact Match (vertical, unique values)

This can be used instead of the VLOOKUP function
When the "match_mode" argument is 0 an exact match is found.
If there is more than one occurrence, the first occurrence is found.
The definition of the first occurrence is the same regardless of whether the table is sorted.
The table does not have to be sorted when you are looking for an exact match. ### Return the Exact Match (horizontal, unique values)

This can be used instead of the HLOOKUP function ### Return the Exact Match (item does not exist)

When the "lookup_value" is not in the list #N/A is returned.
When the "match_mode" argument is 0 an exact match is found. This is the default.
The table does not have to be sorted when looking for an exact match. ### Return the Exact Match (default value)

When the "if_not_found" argument is provided this value will be returned when no match is found.
When the "match_mode" argument is 0 an exact match is found. This is the default.
The table does not have to be sorted when looking for an exact match. ### Return the Exact Match (case sensitive, EXACT)

The XLOOKUP function is not case sensitive.
This means that upper case and lower case characters are equal (for example Japan = JAPAN).
You can perform a case sensitive lookup by using the EXACT function.
The table does not have to be sorted when looking for an exact match. ### Return the Exact Match (first occurrence, sorted or not sorted)

This function will return the first occurrence starting at the top.
When the "match_mode" argument is 0 an exact match is found. This is the default.
When the "search_mode" argument is 1 the first occurrence is found. This is the default.
The table does not have to be sorted to return the first occurrence. ### Return the Exact Match (last occurrence, sorted)

The last occurrence can be achieved when the "lookup_value" column is sorted into Ascending Order.
When the "match_mode" argument is 0 an exact match is found. This is the default.
When the "search_mode" argument is -1 the last occurrence is found.
The table has been sorted by Country and then by Sales. ### Return the Exact Match (last occurrence, not sorted)

The last occurrence can be achieved when the "lookup_value" column is not sorted.
When the "match_mode" argument is 0 an exact match is found. This is the default.
When the "search_mode" argument is -1 the last occurrence is found.
The table does not have to be sorted to return the last occurrence. ### Return the Exact Match (with wildcard *)

An asterisk (*) matches any sequence of text characters (not numbers).
When the "match_mode" argument is 2 wildcard characters can be used.
You can have an asterisk as the first character. ### Return the Exact Match (with wildcard ?)

A question mark (?) matches any single text character (not numbers).
When the "match_mode" argument is 2 wildcard characters can be used.
You can have a question mark as the first character. ### Return the Exact Match (multiple criteria)

When you want to return a value in the same row after finding matching values in 2 (or more) columns.

### Return the Closest Match (next smallest)

The next smallest value can be achieved when the "lookup_value" column is sorted into Ascending Order.
When the "match_mode" argument is -1 the next smallest value is found.
The table has been sorted by Sales. ### Return the Closest Match (next largest)

The next largest value can be achieved when the "lookup_value" column is sorted into Descending Order.
When the "match_mode" argument is 1 the next largest value is found.
The table has been sorted by Sales. ### Combining with MATCH

A two-way lookup can be achieved using an XLOOKUP and MATCH combination.
A two-way lookup is when you return the intersection of a matching column with a matching row.
{"ft_lang_label":"__label__en","ft_lang_prob":0.81105834,"math_prob":0.72039473,"size":4575,"snap":"2023-40-2023-50","text_gpt3_token_len":1006,"char_repetition_ratio":0.16014001,"word_repetition_ratio":0.39130434,"special_character_ratio":0.21617487,"punctuation_ratio":0.07891637,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97411585,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],"im_url_duplicate_count":[null,5,null,5,null,5,null,5,null,4,null,5,null,5,null,5,null,5,null,5,null,5,null,5,null,5,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-10-03T17:39:24Z\",\"WARC-Record-ID\":\"<urn:uuid:6208146e-2b4d-4d42-afc4-be589ad09d1a>\",\"Content-Length\":\"26309\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:041b114b-5f25-4a3b-b797-9072f85e8ebe>\",\"WARC-Concurrent-To\":\"<urn:uuid:d6c4ceac-9f53-4f6c-856c-5af5e67972f6>\",\"WARC-IP-Address\":\"20.36.155.75\",\"WARC-Target-URI\":\"https://bettersolutions.com/excel/functions/function-xlookup.htm\",\"WARC-Payload-Digest\":\"sha1:CRWGBKLQ7L7CT6MFHQ2WC227HGGNYQAB\",\"WARC-Block-Digest\":\"sha1:MPGUP6WXV6DA5YDIDFUUCZ2J5C4THDJX\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233511170.92_warc_CC-MAIN-20231003160453-20231003190453-00186.warc.gz\"}"}