This formula allows you to find a value from the left column and gives you a value in the same row from the column number that you choose in the formula to the right. It is widely used by finance and other business professionals for its ability to match data in a large data set. VLOOKUP can search for numeric or string data and returns either numeric or string data.
Syntax
The structure of the formula is as follows:
=VLOOKUP(lookup_value, table_array, col_index_num, approx)
- lookup_value - the leftmost value to use for searching the array
- table_array - the cell range that has the data that you want to search
- col_index_num - the column for the value that you want
- approx - Boolean (True or False) value for getting an approximate match or an exact match; if no value is provided that default will be TRUE for an approximate match
Examples
=VLOOKUP(F3,A2:C98,3,FALSE)
XLOOKUP
XLOOKUP is a relatively new function that was introduced in Excel 2019. It's similar to VLOOKUP, but it has a few important advantages. For one, XLOOKUP can look up values in a range of cells, not just in a single column, and it can look up values to the left as well. This is handy if you have data that's spread out across multiple columns. Another advantage of XLOOKUP is that it can return an approximate match. This can be useful if your data isn't sorted in exactly the right way. Finally, XLOOKUP can return more than one value. This can be handy if you need to return multiple pieces of information about a single item. By default XLOOKUP returns an exact match. Important things to note when working with XLOOKUP:
- The #N/A error is used if the lookup value is not located.
- If the return range/array dimensions aren’t compatible with the look_up array then the formula will show a VALUE! Error.
- The formula accepts numeric and string data and returns numeric and string data, including multiple items
Syntax
XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])This function has the following arguments:
- lookup_value - the value to use for searching the array
- lookup_array - the range to find the lookup_value
- return_array - the range to find the value to return
- [if_not_found] - [Optional] Refers to the value to be returned when no match is found.
- [match_mode] - [Optional] Specifies the type of the match
- [search_mode] - [Optional] Specifies the mode of the search
- Not_found - [Optional] This argument can be used to override the #N/A error.
Examples
The following GIF illustrates the use of SUM and XLOOKUP to sum the total spent for a range of people:
Whether you need to find one piece of data or many VLOOKUP and XLOOKUP are there to help!