The short answer is that "h" in Excel is not a standard function or formula on its own. When people search "h look up on excel," they almost always mean the HLOOKUP function, which searches for a value in the top row of a table and returns a value from a row you specify. However, "h" can also appear in Excel as a time format (hours), a keyboard shortcut, or part of a cell reference. This article explains each meaning, with a focus on HLOOKUP, how to use it, and when to choose it over VLOOKUP or XLOOKUP.
What HLOOKUP Actually Does
HLOOKUP stands for "Horizontal Lookup." It is a built-in Excel function designed to find something in the top row of a table and then pull a matching piece of data from a row further down. The "H" distinguishes it from VLOOKUP (Vertical Lookup), which searches the first column instead of the first row.
The function takes four arguments, written like this:
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
- lookup_value: the item you are searching for (e.g., a product name or a date).
- table_array: the range of cells that contains the data, including the top row where the search happens.
- row_index_num: the row number (within the table) from which to return a value. The top row is row 1, the next is row 2, and so on.
- range_lookup: optional. Use
FALSEfor an exact match, orTRUE(or omit it) for an approximate match. For most real-world work, useFALSE.
For example, if you have a table where row 1 contains months (Jan, Feb, Mar) and row 2 contains sales figures, =HLOOKUP("Feb", A1:D2, 2, FALSE) would return the sales number for February.
How to Use HLOOKUP Step by Step
Here is the practical workflow for building an HLOOKUP formula in Excel (desktop or web). The menu labels can differ slightly by version, but the core steps are the same.
- Arrange your data so that the value you want to search for is in the top row of your table. The data you want to retrieve must be in a row below it.
- Click an empty cell where you want the result to appear.
- Type
=HLOOKUP(to start the formula. Excel will show a tooltip listing the arguments. - Click the cell that contains the value you are looking up, or type it directly in quotation marks (e.g.,
"Feb"). - Type a comma, then select the entire table range (including the top row and the row with the result).
- Type a comma, then enter the row number (within that selected range) that holds the data you want. For instance, if the top row is row 1 and your data is in the second row of the table, enter
2. - Type a comma, then enter
FALSEfor an exact match. Close the parenthesis and press Enter.
If you get a #N/A error, the lookup value is not in the top row, or the data has extra spaces. If you get a #REF! error, your row_index_num is larger than the number of rows in the table range.
HLOOKUP vs. VLOOKUP vs. XLOOKUP
Choosing the right lookup function depends entirely on how your data is laid out.
- HLOOKUP is for data arranged horizontally, where the search key is in a row and matching values are in rows below it. It is less common than VLOOKUP because most datasets are column-based.
- VLOOKUP is for vertical data, where the search key is in the leftmost column and values are in columns to the right. It is the more familiar tool for most users.
- XLOOKUP is the modern replacement for both. It works in any direction (left, right, up, or down), does not require the lookup value to be in the first row or column, and has a built-in "if not found" message. It is available in Excel 365 and Excel 2021, but not in older versions like Excel 2016 or 2019.
- #N/A error: The lookup value is not in the top row, or it is there but with different formatting (e.g., text vs. number, or extra spaces). Check for trailing spaces and use
TRIM()if needed. - Wrong row_index_num: If you select a table range that starts on row 5 (so the top row is row 5), then the second row of the table is row 6, not row 2. Count rows from the top of the selected range, not from the worksheet top.
- Approximate match surprises: If you omit the fourth argument or use
TRUE, HLOOKUP assumes the top row is sorted and returns the largest value that is less than or equal to the lookup value. This often returns the wrong result. Always useFALSEfor exact matches unless you deliberately want an approximate match (e.g., for tax brackets). - #REF! error: The row_index_num is greater than the number of rows in the table_array. For example, if your table has 3 rows and you ask for row 4, you get this error.
- XLOOKUP: Use
=XLOOKUP(lookup_value, lookup_array, return_array). It works in any direction and is the recommended modern function. It is available in Excel 365 and Excel 2021. - INDEX and MATCH: The combination
=INDEX(return_range, MATCH(lookup_value, lookup_range, 0))is more flexible than HLOOKUP and works in all Excel versions. It is slightly harder to write but very reliable. - VLOOKUP: If your data is column-based, just use VLOOKUP. It searches the first column instead of the first row.
As a rule of thumb: if your data is in columns, use VLOOKUP or XLOOKUP. If your data is in rows, use HLOOKUP or XLOOKUP. XLOOKUP is easier to write and less error-prone, but HLOOKUP still works fine in older files and is worth knowing if you inherit a legacy spreadsheet.
Other Meanings of "H" in Excel
Outside of HLOOKUP, the letter "h" appears in Excel in a few other contexts that might explain a search.
Time format: In cell formatting, "h" represents hours. A custom number format like h:mm displays a time value as hours and minutes (e.g., 1:30). The format [h]:mm shows total elapsed hours, which is useful when a time exceeds 24 hours (e.g., 30:15 for 30 hours and 15 minutes).
Keyboard shortcut: Pressing Ctrl+H opens the Find and Replace dialog box with the Replace tab selected. This is a common way to find and replace text or values in a worksheet. Many users refer to this as "the h shortcut" or "find and replace h."
Cell reference: The letter "H" is also a column label (column H). A reference like H5 means the cell at column H, row 5. This is not a function, just a standard address.
Common HLOOKUP Problems and Fixes
HLOOKUP fails more often than VLOOKUP, usually because the data layout is not what the function expects. Here are the most frequent issues.
If HLOOKUP keeps failing, the simplest fix is to switch to XLOOKUP, which does not care about row or column position. The formula =XLOOKUP("Feb", A1:D1, A2:D2) does the same job as the HLOOKUP example above, but is easier to read and maintain.
When You Should Not Use HLOOKUP
HLOOKUP is the right tool only when your lookup key is in the top row. If your data is column-based, using HLOOKUP will force you to rearrange your table, which is a waste of time and a source of errors.
Also avoid HLOOKUP when your table has more than a few rows. Because HLOOKUP searches only the top row, it is easy to accidentally select the wrong range when the table is large. XLOOKUP or VLOOKUP are more forgiving.
Another limitation: HLOOKUP can only return a value from a row below the lookup row. It cannot return a value from a row above the lookup key. If you need to look up and to the left, you must use XLOOKUP or INDEX/MATCH.
Finally, HLOOKUP does not handle duplicate values in the top row well. It returns the first match it finds, which may not be the one you want. If duplicates are possible, consider using XLOOKUP with the match_mode argument set to 0 (exact match) and be prepared to handle multiple results manually.
If That Did Not Work: Alternatives
If HLOOKUP is not working or is not available, here are three reliable alternatives.
If you are still stuck, check that your data does not contain merged cells in the top row, as merged cells can break HLOOKUP. Unmerge the cells and repeat the lookup value in each column if necessary.
Frequently Asked Questions
What does the "H" stand for in HLOOKUP?
The "H" stands for "Horizontal." It tells Excel to search across a row (horizontally) rather than down a column. The function is designed for tables where the lookup value is in the top row.
Is HLOOKUP the same as VLOOKUP?
No. HLOOKUP searches the top row and returns a value from a row below. VLOOKUP searches the first column and returns a value from a column to the right. They are mirror images of each other, but VLOOKUP is used far more often because most data is arranged in columns.
Why is my HLOOKUP returning #N/A?
#N/A means the lookup value was not found in the top row of your table range. Check for extra spaces, text vs. number formatting, or make sure the lookup value is actually in the first row of the range you selected. Using FALSE for the last argument forces an exact match, which is usually what you want.
Can I use HLOOKUP to return a value from a row above the lookup row?
No. HLOOKUP can only return values from rows below the top row of the table. If you need to look up and to the left, use XLOOKUP or INDEX/MATCH instead.
Does HLOOKUP work in Excel 365?
Yes, HLOOKUP still works in Excel 365 for compatibility, but Microsoft recommends XLOOKUP for new workbooks. XLOOKUP is more flexible, easier to read, and does not have the row/column direction limitations of HLOOKUP.
How do I fix a #REF! error in HLOOKUP?
#REF! means your row_index_num is larger than the number of rows in the table_array. For example, if you selected a range with 3 rows and asked for row 4, you get this error. Reduce the row_index_num or expand the table range.