This blog post will explore the Index and Match functions in Excel as part of the lookup and reference function categories. There is nothing wrong with the Vlookup unless you need to find a reference value that is further left than what you fetched (the lookup value). Vlookup only works if your data table has the lookup value in the leftmost column. In my example the country code is to the right of the Country field. Check out my blog post on Vlookup and another video post here if you are not familiar with how to write a Vlookup formula. Below is a caption of the data this post will use. At the end of my blog post, you can download the Excel file yourself to practice along on your own.
In this example we will have Excel tell us what position down is 500 among the Code field. The Match function returns the relative position of an item in an array that matches a specified value in a specified order. Once we have that number, then we can nest the Match function inside of the Index function. Lookup Value: 500 Lookup Array: B2:B18. Use absolute referencing ($B$2:$B$22) or range names when you need to copy the formula. Match Type: Almost always 0 or false because you are looking up an exact match. This argument is similar to the match type argument of the Vlookup.
The answer is 5 because it is the 5th position in the range of codes. Knowing 5 will be important because we can use it (Match value return) nested inside the Index function. The Index function returns a value or a reference of the cell at the intersection of a particular row and column, in a given range. The Index function has two types of function arguments. This post will explore the first type which uses only 2 arguments.
Index Arguments: Array: The range of cells where the return value will be found. Row_Num: A number that you want to go down to find. Col_Num: optional – alternative to the row number.
Use the Match function in the Row_Num argument. Example Using Index and Match together:
Download this practice file here. View my PowerPoint slide deck with other examples of Match and Index here.
If you would like to be notified when I post a new blog entry, you can enter your email in the subscribe box on the right side bar.