← All comparisons

VLOOKUP vs HLOOKUP: vertical or horizontal?

They're the same function rotated 90°: VLOOKUP searches the first COLUMN and reads across; HLOOKUP searches the first ROW and reads down. VLOOKUP dominates because data almost always grows downward — but when you meet a horizontal table, HLOOKUP (or better, XLOOKUP) is the answer.

The differences at a glance

VLOOKUPHLOOKUP
SearchesFirst column of the rangeFirst row of the range
Returns fromA column N to the rightA row N below
Typical data shapeRecords as rows (normal tables)Time periods or attributes as columns
Same pitfallsApproximate-match default, positional indexIdentical — pass FALSE, count rows carefully
Modern replacementXLOOKUP (any direction)XLOOKUP works sideways too — one function replaces both
CompatibilityUniversalUniversal (every version of all three apps we test)

Which should you use?

Compatibility (from executed tests)

Both execute correctly in every version of Excel, Google Sheets, and LibreOffice we test — they're part of the ancient core. XLOOKUP, which replaces both directions, needs Excel 2021+/365, current Sheets, or LibreOffice 24.8+ (verified: #NAME? in LO 24.2).

Example formulas

VLOOKUP (data in rows)=VLOOKUP("cherry",A2:B10,2,FALSE)
HLOOKUP (months across the top)=HLOOKUP("Mar",B1:M5,3,FALSE)
XLOOKUP (replaces both)=XLOOKUP("Mar",B1:M1,B3:M3)

Full per-version details on each function page: VLOOKUP · HLOOKUP.