Locked lesson.
About this lesson
XLOOKUP and VLOOKUP enable you to merge data to add greater context to the data.
Quick reference
XLOOKUP AND VLOOKUP
Vlookup
=VLOOKUP(lookup_value, table_array, column index, [range lookup])
- Lookup value: this is the “what” you are looking for – the value from the first data set that you will use to find a similar value in the second data set to return a related value
- Table array: the “where” you will look to find the “what”. The second data set, with the lookup value in the left-most column of the range and the required return value to the right of that
- Column index: the “return value”, the number of the column in the table array that contains the value you need to be returned.
- Range lookup: Exact or approximate match. The squared brackets indicate the argument is optional and the function will work without you adding an argument here. Excel uses a default approximate match if you don’t specify. We used exact match in the video – Excel will return a #N/A if you use an exact match and it cannot find what you are looking for.
- Limitation: Vlookup is programmed to look for a value in the left column of the table array and can return a value to the right. If your return value is to the left of your search value, you will have some adjustment to do in your table before you can use a vlookup. There are, of course many ways to accomplish this, but this is not the place to explain other options – the XLOOKUP solves the problem.
- Error messages:
- #N/A - Excel cannot find the value
- #Ref - you supplied a 2 column table array and want a value from column 3
Xlookup
Note that XLOOKUP is only available in Microsoft 365
=XLOOKUP(lookup value, lookup array, return array, [if not found], [match mode], [search mode]
- Lookup value: this is the “what” you are looking for – the value from the first data set that you will use to find a similar value in the second data set to return a related value
- Lookup array: this is the “where”, you’ll notice the xlookup splits the table array into two separate arrays – the lookup and the return array.
- Return array: this is the column that contains the return value. It must be the same height as the lookup array, otherwise you’ll get an error message (#REF)
- If not found: the square brackets indicating an optional argument. This is used to specify a message to the user if the value is not found to replace the #N/A
- Match mode: Exact or approximate match, also optional argument. BUT the default is exact. Excel has a few more options where the approximate match is concerned, but you’ll have to refer to GoSkills free resource articles for more info.
- Search mode: Not covered in the video – optional argument, and useful to consider when you work with really large amounts of data that slows down your computer. Again, GoSkills has a free resource article if you are interested to learn more.
- Error messages:
- #VALUE - if the return array and the lookup array is not the same size
- #N/A - value cannot be found
Lesson notes are only available for subscribers.