Excel tutorial
/

Functions

Intermediate

How to use HLOOKUP in Excel: look up values in a horizontal table

HLOOKUP finds values in a table whose headers run across a row: months, tariffs, tiers. Syntax, row number, TRUE vs FALSE and common traps — with examples.

HLOOKUP is VLOOKUP’s twin for horizontal tables. It searches for a value in the first row of a table and returns a result from a lower row in the matching column. The name stands for “horizontal lookup” — searching from left to right.

When you need it: a plan-vs-actual report with months across the columns, a delivery tariff with weight tiers along a row, figures by year. In other words, any table whose headers sit at the top, along a row.

Книга1 - Excel
—☐✕
B6fx=ГПР(B5;$A$1:$F$3;3;ЛОЖЬ)
ABCDEFG
1MonthJanFebMar2AprMay
2Plan120130150140160
3Actual1181351493150171
4
5Month:Mar1
6Actual:149
7
Готово
Sales, million soums. HLOOKUP finds “Mar” (1) in the first row (2) and returns the actual figure from row 3 of that column (3)

Syntax

=ГПР(lookup_value; table_array; row_index_num; [range_lookup])

  • lookup_value — what to find: a month, year or code.
  • table_array — the table. The search happens only in its first row.
  • row_index_num — which row of the table to return. The header row is 1, the next one is 2, and so on.
  • range_lookup — FALSE (0) for an exact match; TRUE or omitted for an approximate match (the first row must increase from left to right).

The only difference from VLOOKUP: VLOOKUP asks for a column number, HLOOKUP asks for a row number.

Writing HLOOKUP step by step

1

Select the result cell (B6). Формулы → Ссылки и массивы → HLOOKUP.

Книга1 - Excel
—☐✕
ФайлГлавнаяВставкаРазметка страницыФормулыДанныеРецензированиеВидСправка
Вставить функциюАвтосуммаФинансовыеЛогическиеТекстовыеДата и времяСсылки и массивыМатематические
Библиотека функций
Диспетчер имён
Определённые имена
B6fx
ABCDEFG
1MonthJanFebMarAprMay
2Plan120130150140160
3Actual118135149150171
4
5Month:Mar
6Actual:
7
Готово

2

Enter the arguments: Lookup_value — B5; Table_array — select A1:F3 and press F4; Row_index_num — 3 (Actual is row 3 of the table); Range_lookup — FALSE.

Книга1 - Excel
—☐✕
B6fx
ABCDEFG
1MonthJanFebMarAprMay
2Plan120130150140160
3Actual118135149150171
4
5Month:Mar
6Actual:
7
ГотовоСреднее: 142,3Количество: 18Сумма: 1423

3

Click OK. Now change the month in B5 — type “May”, for example. The formula instantly shows May’s actual: one cell lets you “query” any month.

Книга1 - Excel
—☐✕
B6fx=ГПР(B5;$A$1:$F$3;3;ЛОЖЬ)
ABCDEFG
1MonthJanFebMarAprMay
2Plan120130150140160
3Actual1181351491501712
4
5Month:May1
6Actual:171
7
Готово

Approximate match: a delivery tariff

A courier service charges by weight tier: up to 1 kg — 15,000, 1–5 kg — 25,000, and so on. Put the starting weight of each tier in the first row in ascending order and use TRUE.

HLOOKUP takes the closest tier that is not greater than the weight you look up: for 7 kg, that is the 5 kg column.

Книга1 - Excel
—☐✕
C6fx=ГПР(B6;$B$1:$F$2;2;ИСТИНА)
ABCDEFG
1Weight, kg01521020
2Price, soum15 00025 00040 00060 00090 000
3
4ClientWeight, kgDelivery
5Aziz0,815 000
6Dilnoza7140 000
7Javohir12,560 000
8
Готово
7 kg (1) is not in the table — HLOOKUP takes the 5 kg tier (2) and returns 40,000 soums

Pro level: pick the row number with MATCH

When a report has several measures (plan, actual, number of clients), don’t type the row number by hand — let MATCH find it in the first column:

=ГПР(B6;$A$1:$E$4;ПОИСКПОЗ(B7;$A$1:$A$4;0);ЛОЖЬ)

Now you choose a month and a measure in two cells and get any intersection of the table. That is a two-way lookup.

Two more tips:

  • In Excel 2021/365, =ПРОСМОТРX(B6;B1:E1;B3:E3) does the same job: no row number needed, and the result row may even be above.
  • If the data is yours and still horizontal, it is often better to store it vertically (Paste Special → Transpose): vertical tables are easier to filter, sort and summarize with a PivotTable.
Книга1 - Excel
—☐✕
B8fx=ГПР(B6;$A$1:$E$4;ПОИСКПОЗ(B7;$A$1:$A$4;0);ЛОЖЬ)
ABCDEF
1MeasureJanFebMarApr
2Plan120130150140
3Actual118135149150
4Clients410455470502
5
6Month:Apr
7Measure:Clients
8Result:502
9
Готово
MATCH finds the row number of “Clients” (4), and HLOOKUP takes the value from the “Apr” column — 502

Try it in the simulator

The delivery tariff is at the top. Type =ГПР(B5;$B$1:$F$2;2;ИСТИНА) in C5 and fill it down to C7. Then change the weight in B6 to 10 and watch which tier the price moves to.

Книга1 - Excel
—☐✕
Буфер обмена
Шрифт
Выравнивание
Число
Стили
Ячейки
Редактирование
✕✓fx
ABCDEFGHIJKLMNOPQRSTUVWX
1Weight, kg0151020
2Price, soum1500025000400006000090000
3
4ClientWeight, kgDelivery
5Aziz2,5
6Dilnoza0,5
7Javohir18
8
9
10
11
Лист1
Готово

Has ExcelLab been useful?

Support the project and help us release new lessons and exercises.

Support us
Previous

95 / 154