How do I use the HLOOKUP function in Excel?

To use the HLOOKUP function in Excel, follow these steps:

1. Understand the HLOOKUP Function: HLOOKUP stands for "Horizontal Lookup." It searches for a value in the top row of a table or array and returns a value in the same column from a specified row.

2. Syntax of HLOOKUP: The syntax of the HLOOKUP function is:
`=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])`

- `lookup_value`: The value to search for in the first row of the table.
- `table_array`: The range of cells that contains the data. The first row of this range should contain the values to search for.
- `row_index_num`: The row number in the table from which to retrieve the data. The first row is 1.
- `range_lookup`: This is optional. If TRUE (or omitted), HLOOKUP will find the closest match. If FALSE, an exact match is required.

3. Select the Cell: Click on the cell where you want the result to appear.

4. Enter the Formula: Type `=HLOOKUP(` in the formula bar.

5. Enter Parameters:
- Enter or select the `lookup_value`.
- Enter the `table_array` by selecting the range of cells that contain the data, ensuring the first row contains the values to search for.
- Enter the `row_index_num` specifying which row's value you want to retrieve.
- Optionally, specify `range_lookup` as TRUE or FALSE.

6. Complete the Formula: Close the brackets and press `Enter`.

7. Example: Let's say you have a table with student names in the first row, and their scores in subsequent rows. To find the score of a specific student, you can use HLOOKUP.



=HLOOKUP("John", A1:D4, 3, FALSE)



In this example:
- `"John"` is the lookup value.
- `A1:D4` is the table array.
- `3` indicates to fetch data from the 3rd row.
- `FALSE` specifies an exact match.

8. Result: Excel will return the score of "John" from the 3rd row of the table.

By following these steps, you can effectively use the HLOOKUP function in Excel to search for values horizontally in a table.
How do I use the HLOOKUP function in Excel?

Related Questions