Lookup Functions: VLOOKUP, HLOOKUP, INDEX/MATCH
In this blog post, we will explore three common lookup functions in Excel: VLOOKUP, HLOOKUP and INDEX/MATCH. These functions allow you to search for a value in a table or range and return a corresponding value from another column or row.
VLOOKUP stands for vertical lookup. It searches for a value in the first column of a table and returns a value from another column in the same row. The syntax is:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
HLOOKUP stands for horizontal lookup. It searches for a value in the first row of a table and returns a value from another row in the same column. The syntax is:
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
INDEX/MATCH is a combination of two functions: INDEX and MATCH. INDEX returns a value from a specific position in a range or array. MATCH returns the relative position of a value in a range or array. Together, they can perform both vertical and horizontal lookups. The syntax is:
=INDEX(array, MATCH(lookup_value, lookup_array, [match_type]))
Conclusion
Lookup functions are useful tools to retrieve data from tables or ranges based on criteria. VLOOKUP and HLOOKUP are simple and easy to use but have some limitations such as requiring sorted data and being unable to handle multiple criteria. INDEX/MATCH is more flexible and powerful but requires more complex formulas.
FAQs
Q: What is the difference between exact match and approximate match in lookup functions?
A: Exact match means that the lookup value must match exactly with one of the values in the lookup array. Approximate match means that the lookup value can be smaller than or equal to one of the values in the lookup array.
Q: How can I use multiple criteria in lookup functions?
A: One way is to concatenate multiple criteria into one lookup value using the & operator and create an extra column or row with concatenated values in the table array. Another way is to use an array formula with logical operators such as AND or OR.
Q: How can I avoid errors such as #N/A or #REF in lookup functions?
A: One way is to use error handling functions such as IFERROR or IFNA to specify what to return if an error occurs. Another way is to check your data for typos, missing values or incorrect references.
Previous Chapter
Next Chapter