Google Sheets HLOOKUP Function: Syntax, Examples & Tips

The HLOOKUP function searches for a value in the first row of a table and returns a value in the same column from a specified row.
Google Sheets
HLOOKUP(search_key, range, index, [is_sorted])

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What is an HLOOKUP?
  3. A Practical Example
  4. HLOOKUP Formula
  5. Result of the Formula
  6. Why Use HLOOKUP?
  7. Key Takeaways:
  8. Example use case

Parameters

search_key:
The value that you want to search for in the first row of the specified range.

range:
The range of cells that contains the data you want to search through. The first row of this range is where the search_key will be looked up.

index:
The row number in the range from which to return the value. The first row is 1, the second row is 2, and so on.

is_sorted:
An optional parameter that indicates whether the first row of the range is sorted. If TRUE or omitted, an approximate match is returned; if FALSE, an exact match is required.

What is an HLOOKUP?

The HLOOKUP function in Google Sheets is a useful tool that allows you to search for a value in the first row of a range or array and return a corresponding value from a specified row within that range. It is particularly helpful when dealing with horizontal data layouts, making it easier to retrieve information from tables organized in rows.

In simpler terms, HLOOKUP enables you to find specific data in a horizontal table and retrieve related information from that table efficiently.

A Practical Example

Imagine you are managing a student database with their scores stored in a Google Sheets spreadsheet:

Students Table:

StudentIDNameMathScienceEnglish
001Alice859088
002Bob788280
003Charlie929594

You want to find the score of each student in a specific subject.

HLOOKUP Formula

To achieve this, you would use the HLOOKUP function as follows:

Google Sheets
=HLOOKUP("Math", Students!A1:E4, 3, FALSE)

In this formula:

  • "Math" is the value you are searching for in the first row of the Students Table.
  • Students!A1:E4 is the range where the function will look for the subject name and return the corresponding scores.
  • 3 indicates that you want to return the value from the third row of the specified range.
  • FALSE specifies that you want an exact match for the search.

Result of the Formula

When you apply the HLOOKUP formula, the output would show the Math scores as follows:

SubjectScore
Math85
Math78
Math92

If you were to change the subject in the HLOOKUP formula to "Science", the result would update accordingly:

Google Sheets
=HLOOKUP("Science", Students!A1:E4, 3, FALSE)

This would return:

SubjectScore
Science90
Science82
Science95

Why Use HLOOKUP?

HLOOKUP is beneficial because it simplifies the process of looking up data in horizontal tables. It allows for quick retrieval of information without the need for complex formulas. However, it is important to note that HLOOKUP can only search for values in the first row of the specified range, which may limit its versatility compared to other lookup functions.

Key Takeaways:

  • HLOOKUP: A Google Sheets function that searches for a value in the first row and returns a corresponding value from a specified row.
  • Horizontal Data: Ideal for tables organized in rows, making it suitable for specific data layouts.
  • Exact Match: Offers the ability to specify whether you want an exact match or an approximate match.
  • Common Use Cases: Useful for retrieving scores, product information, or any scenario where data is organized horizontally.

HLOOKUP is a valuable function for anyone working with horizontal data in Google Sheets, providing a straightforward way to enhance data analysis and reporting capabilities.

Happy spreadsheeting!

Example use case

You have a table where Row 1 contains product IDs and Row 2 contains their corresponding prices. You can use HLOOKUP to enter a product ID and quickly retrieve its price. This streamlines pricing queries and enhances inventory management efficiency.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.