Skip to main content
 

Excel HLOOKUP function

Author: Sun Last Modified: 2019-06-21

doc hlookup function 1

Description

Syntax and Arguments

Usage and Examples


Description

The HLOOKUP function looks up a value in top row of a table or an array from left to right horizontally, then returns a value in the same column from the specified row. The HLOOKUP function can return approximate or exact matching, and use wildcards * or ? for finding partial matches.

Syntax and Arguments

Formula syntax

=HLOOKUP (value, table, row_index, [range_lookup])

Arguments

  • Value: Required, the look up value.
  • Table: Required, the table or array you retrieve values from.
  • Row_index: Required, the number of row that the matching value is in.
  • Range_lookup: Optional. 1 means true, which return matching approximately; and 2 means false, which return matching exactly. Omitted is true.

Notes

1) When range_lookup is true, it returns the largest value which is less than look_value while there is no exact matching.

2) When range_lookup is true, the values in the top row of table_array must be placed in ascending order such as 1000,2000,3000…, or it returns #N/A error value.

3) If look_up value is smaller than the smallest value in top row of table_array, it returns #N/A error value.

Return Value

The HLOOKUP function returns a value in the same column from a row that you specify in the table or an array.

Usage and Examples

Example 1 – lookup in a table or a range

If Range_lookup is true:

=HLOOKUP(B5,$A$1:$E$2,2)

Or

=HLOOKUP(B5,$A$1:$E$2,2,1)

Or

=HLOOKUP(B5,$A$1:$E$2,2,TRUE)
doc hlookup function 2

It returns values matching approximately.
doc hlookup function 3


If Range_lookup is false:

=HLOOKUP(B5,$A$1:$E$2,2,0)

Or

=HLOOKUP(B5,$A$1:$E$2,2,FALSE)

It returns values exact matched or error values if there is no value exactly matched.
doc hlookup function 4


Example 2 – lookup in an array

Formula:

=HLOOKUP("c",{"a","b","c";12,13,14;"Nancy","Kate","Tom"},3)

Explain:

“c”: look_up value, non-numeric value needed to be enclosed with quotation marks.

{"a","b","c";12,13,14;"Nancy","Kate","Tom"}: array table you will lookup and retrieve values from, comma used as column separator, semicolon used as row separator.

3: row_index, the third row in the array table.

Return: Tom
doc hlookup function 5


Sample File
doc sample file


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.