# Vlookup and Hlookup Functions

Lookup functions are fundamental in Excel and are often tested in Excel proficiency interviews. Among the basic lookup functions, we distinguish Vertical Lookup (VLOOKUP) and Horizontal Lookup (HLOOKUP). Another form of lookup was mentioned in the discussion about INDEX/MATCH.

VLOOKUP is a function designed for searching data in a vertically organized table. It allows for exact matches as well as approximate matches using ‘*’. The values to be searched must be in the first column of the specified range in the formula. Based on this, the formula returns the value from the selected column in the specified range. Let’s discuss the formula below:

=VLOOKUP(value, table, column index, [type of returned value])

- Value: The value you are searching for.
- Table: The table to be searched.
- Column Index: The number of the column from which you want to get the result.
- Type of Value (optional): There are two options to choose from:
- TRUE (TRUE or 1): Approximate result
- FALSE (FALSE or 0): Exact result

Horizontal lookup works on the same principle, but in this case, we choose the row number from the table.

As mentioned above, VLOOKUP/HLOOKUP functions have two types of returned values: approximate and exact. A good use of the TRUE argument is to return a grade based on the result. It’s important to note that the approximate value returned by the function is the closest larger one in the set, so our set of grades should be sorted from lowest to highest before searching. What if we don’t provide any type of value argument? The function will first attempt to return an exact result, and if it doesn’t find one, it will apply an approximate match.

Another important aspect of VLOOKUP/HLOOKUP functions is how they handle duplicates. The formula always returns the first found search result. VLOOKUP can also be combined with the MATCH function if we want a dynamically chosen column number.