Succeeded by XLOOKUP
Use XLOOKUP, unless the file has to work in older Excel.
HLOOKUP has served well for tables that run left to right and it still works. But since Excel 2021 there is a successor that does the same job with less counting and fewer silent mistakes: XLOOKUP.
Which one should I use?
Why XLOOKUP is better
- It looks upwards too. The row with the keys no longer has to be the top row of the table.
- No row number to count. You point at the row you want back, so inserting a row does not break the formula.
- Exact match is the default. Forget the FALSE at the end of HLOOKUP and it returns a wrong value without a warning; XLOOKUP does not.
- A built-in message for missing values, without wrapping the formula in IFERROR.
- It can search from right to left, to find the latest period with an entry.
HLOOKUP (every version)
=HLOOKUP(H2,A1:F3, 3, FALSE)
=HLOOKUP(H2;A1:F3; 3; FALSE)
HLOOKUP HORIZ.ZOEKENOlder horizontal lookup across the first row.Read more about HLOOKUPPress Escape to close
lookup_valueThe value to find in the first row of the table.Press Escape to close
table_arrayThe table; the lookup row must be its first row.Press Escape to close
row_index_numWhich row of the table holds the answer, counting from 1.Press Escape to close
range_lookup (optional)FALSE for an exact match; TRUE or omitted for approximate.Press Escape to close
XLOOKUP (Excel 2021 and Microsoft 365)
=XLOOKUP(H2,A1:F1, A3:F3)
=XLOOKUP(H2;A1:F1; A3:F3)
XLOOKUP X.ZOEKENFinds a value and returns the matching item from another range.Read more about XLOOKUPPress Escape to close
lookup_valueThe value you are looking for.Press Escape to close
lookup_arrayThe one column or row to search in.Press Escape to close
return_arrayThe range the answer comes from.Press Escape to close
Need HLOOKUP for an older file?
The full HLOOKUP page has the syntax, the arguments, the common mistakes and four worked examples, for files that have to work in Excel 2019 or older.
Open the full HLOOKUP page