VLOOKUP and MATCH
VLOOKUP and MATCH
The VLOOKUP function is used to search for information in a specified table. After inserting the
row and column into the function, the formula returns the information in the overlapping cell.
The MATCH function plays a similar role in searching for information. However, its job is to return
the number of the row or column where the input information is found.
The search criteria inserted into the VLOOKUP function is static, meaning that the function relies
on the data source to remain unchanged in order to work correctly. The VLOOKUP fails to return
any result or may return the incorrect result if the source data is altered in any way. This is one of
the limitations of VLOOKUP.
To overcome this issue, the function can be used. The Match function used within the vlookup
formula gives it a name of the column to search rather than just a fixed number of the column to
search. This helps create a function that is more flexible. When VLOOKUP and MATCH are used
together, the function becomes known as a dynamic function.
Syntax
lookup_value: what you want to look up, Excel will search in the first column of the selected
table.
table_array: the table in which you wish to look up
col_index_number: the number of the column to be searched, within the range that you selected.
range_lookup: there are two options that can be selected in this section, FALSE or TRUE. This
will tell Excel if it needs to look for the exact figure (FALSE) or an approximate figure (TRUE).
False can also be written as 0 and true can also be written as 1.
VLOOKUP will return the value in the overlapping column and row cell, as specified in the
formula.
The MATCH function appears in Excel as: =MATCH(lookup_value, lookup_array, [match_type])
lookup_value: what you want to look up, Excel will search in the row or column specified in the
lookup_array
lookup_array: the row or column in which you wish to look up
match_type: three options to be selected in this section, depending on whether you want the
returned number to be an exact match (0), less than (-1) or more than (+1) the lookup value.
The MATCH function will then return the number where the lookup value is within the lookup
array.
However, in the example below we can see the situation in which our existing VLOOKUP fails.
After adding an additional column of “one month performance”, the VLOOKUP comes back with
the incorrect information.
Ideally, once a new column was added, the VLOOKUP should have updated to move its search
criteria to the correct column, and this is exactly what the inclusion of the MATCH function helps to
achieve.
As seen in the example below, by using the MATCH function within the VLOOKUP function, Excel
now looks for which column the information is in (the MATCH function), and then returns the
information in the correct cell (the VLOOKUP function)
https://excel-practice-online.com/exercises/vlookup-exercise-1/
https://excel-practice-online.com/exercises/
Solutions
=LOOKUP(E17,B12:C17)
Solution: Solution :
Formula in E2 of sheet 2 :
=VLOOKUP(A2,Sheet1!$A$2:$D$1475,4,FALSE)
Explanation :
search for the row in Sheet 1 that corresponds to the current row in Sheet 2
extract from the row found the initial department stored in column D
The key value between the list in Sheet 1 and the list in Sheet 2 is the name of the
staff.
in the 1st argument, the name, i.e. the value of cell A2 of the present sheet
in the 2nd argument, the cell range A2:E1475 of sheet 1. In fact, the name given in
the 1st argument is searched in the 1st column of this range, i.e. column A
in the 3rd argument, it is the value 4. When the name given in the 1st argument is
found in column A of the range A2:D1475, the value corresponding to the
4th column is returned.
in 4th argument, it is the value FALSE for an exact match between the names
written in the two lists.
https://www.fpcourses.com/Excel/En/Exercise.VLOOKUP.HLOOKUP.php
Solution: 2:
=HLOOKUP(105,B3:L8,4,FALSE)
Date:
Index+Match,
Explanation
INDEX MATCH is a lookup function which is considered by many as superior to the old-but-
gold VLOOKUP function
INDEX MATCH, while being considered “one” function, is actually a combination of two Excel
functions – INDEX and MATCH
Example
Well, there are certain issues that make VLOOKUP a really problematic function in some cases:
Have you ever tried to use VLOOKUP when the value to return in your table array was before
the lookup column? If you did try, you would know that this is impossible using VLOOKUP
without manipulating the data:
VLOOKUP doesn’t respond well when one of the columns within the table array is deleted, or a
new column is added. This may cause a wrong result or even a #REF error!
Have you ever tried to VLOOKUP a table array of 50 columns? It is pretty easy to get lost when
working with arrays of this size.
INDEX MATCH’s performance is considered superior to VLOOKUP’s performance, especially in
large tables.
Should you always prefer using INDEX MATCH over VLOOKUP?
Well, the answer is NO. As much as we love INDEX MATCH, its logic is sometimes counter-
intuitive, and some users have very hard time understanding how this functions work together.
For most users, VLOOKUP works fine and is much easier to understand. However, when facing
complex and large tables – INDEX MATCH is definitely a better option.
Syntax
So, after you’ve been convinced that INDEX MATCH is absolutely the best function(s) in Excel,
here’s how we use it:
=INDEX(array,MATCH(lookup_value,lookup_array,[match_type])
First, we use MATCH function to lookup a value (lookup_value) within a column (lookup_array). The
function returns the location of the matched value. We use 0 in [match_type] to make sure we get
an exact match!
Then, we use the position received from the MATCH function, and use this position within the
INDEX function, to return the corresponding value from our results column (array).
Here’s a nice example of how INDEX MATCH works: