The HLOOKUP() function searches for a value in the first row of a table and returns a value from a specified row in the same column.
Note: HLOOKUP() is less commonly used than VLOOKUP(), but it's still useful when your data is organized horizontally.
๐ What is the HLOOKUP() Function?
HLOOKUP stands for Horizontal Lookup.
It searches horizontally across the first row and returns a value from the specified row.
Syntax:
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])๐ Arguments Explained
โข lookup_value โ The value you want to search for
โข table_array โ The data table
โข row_index_num โ The row number to return the value from
โข range_lookup
โข FALSE โ Exact match (recommended)
โข TRUE โ Approximate match
๐ Example
Jan Feb Mar Apr
Sales 50000 60000 55000 70000
Profit 8000 10000 9000 12000
To find the Profit for March:
Formula:
=HLOOKUP("Mar",A1:E3,3,FALSE)Result: 9000
๐ Using a Cell Reference
If cell G2 contains the month name:
=HLOOKUP(G2,A1:E3,3,FALSE)Changing the month in G2 automatically returns the corresponding profit.
๐ Common Errors
โ Searching in a row other than the first row
โ Using an incorrect row index number
โ Forgetting to use FALSE for an exact match
โ Getting #N/A when the lookup value doesn't exist
Handle errors using:
=IFERROR(HLOOKUP(G2,A1:E3,3,FALSE),"Not Found")๐ Limitations of HLOOKUP()
โข Searches only in the first row
โข Works only from top to bottom
โข Less flexible than INDEX()/MATCH() or XLOOKUP()
โข Rarely used because most Excel datasets are arranged vertically
๐ Real-World Uses
โข Retrieve monthly sales or profit from summary tables
โข Find quarterly performance
โข Fetch values from horizontally structured reports
โข Build financial summary dashboards
โ Best Practices
โข Use FALSE for exact matches
โข Ensure the lookup value is in the first row
โข Combine HLOOKUP() with IFERROR() for user-friendly reports
โข Prefer XLOOKUP() for modern Excel workbooks, as it supports both vertical and horizontal lookups
Although HLOOKUP() is less common today, understanding it will help you work with legacy Excel files and prepare for interviews.
Double Tap โค๏ธ For More