Introduction
What is HLOOKUP
Syntax of HLOOKUP
Example
Tips to Remember
Common Uses of HLOOKUP
Limitations of HLOOKUP
Better Option – XLOOKUP
Conclusion
Introduction
When you need to search for data that is arranged in rows rather than columns, the HLOOKUP function in Excel is the best choice.
HLOOKUP stands for Horizontal Lookup. It helps you find a value in the top row of a range and return a value from a row below it.
What is HLOOKUP
HLOOKUP is a built-in Excel function used to:
- Search for a value in the first row of a data range
- Return a value from a specific row in the same column
Syntax of HLOOKUP
HLOOKUP(lookup_value, table_array, row_index_num, range_lookup)
- lookup_value – The value you want to find in the first row
- table_array – The range that contains the data
- row_index_num – The row number from which to return the value
- range_lookup – Optional
- Use
TRUEfor approximate match - Use
FALSEfor exact match
Example
Imagine this data:
- Row 1: Student IDs – 101, 102
- Row 2: Names – John, Rita
- Row 3: Scores – 85, 92
To find the name of the student with ID 101, use the formula:
HLOOKUP(101, A1 to C3, 2, FALSE)
Result: John
Explanation: The function looks for 101 in the top row and returns the value from the second row in the same column.
Tips to Remember
- The lookup value must be in the first row
- Use FALSE for an exact match
- Use TRUE for an approximate match
- HLOOKUP works only with horizontal data
- If your data is vertical, use VLOOKUP instead
- HLOOKUP always searches top to bottom and cannot look in reverse
Common Uses of HLOOKUP
- Checking student marks when IDs are in the top row
- Comparing monthly sales when months are listed horizontally
- Creating dashboards where values are arranged in rows
Limitations of HLOOKUP
- Does not work with vertical data
- Cannot return values from rows above the first row
- Sensitive to changes in the structure of the table
- Cannot search to the left or above
Better Option – XLOOKUP
If you're using Excel 365 or Excel 2021, it's better to use XLOOKUP:
- Can search both horizontally and vertically
- No need to count row or column numbers manually
- More flexible and user-friendly than HLOOKUP or VLOOKUP
Conclusion
HLOOKUP is a useful and simple function for working with horizontal data in Excel.
Once you understand its structure, it becomes a powerful tool for handling:
- Marksheets
- Sales reports
- Data dashboards