VLOOKUP vs. HLOOKUP: One Looks Down, the Other Looks Across


HLOOKUP and VLOOKUP formula

VLOOKUP and HLOOKUP do the same basic job—but they look in completely different directions.

Here's the easiest way to remember them: VLOOKUP goes vertical. HLOOKUP goes horizontal. That's it.

Picture a potluck at work. You've got a sheet with everyone's name, their department, and what they're bringing. I laid out that same information two ways: a normal table running top to bottom on the left, and the same data flipped sideways on the right, with names running across the top instead.

That's really the key difference between the two. VLOOKUP searches down a column; HLOOKUP searches across a row. Neither one is better. The direction of your table determines which one makes sense.

VLOOKUP: The Vertical Table

If I want to know what Kevin's bringing from the left-hand table, the formula is:

=VLOOKUP(B9, A3:C6, 3, FALSE)

  • B9 is the cell where I typed his name.
  • A3:C6 is the table Excel searches—it scans down the first column looking for a match.
  • 3 tells Excel to return the value from the third column of the table, which happens to be the dish. Change that to a 2, and you'd get his department instead.
  • FALSE tells Excel to look for an exact match. For names, IDs, and other text values, this is usually what you want.

HLOOKUP: The Horizontal Table

Same question, same answer, but the table on the right is built sideways, so the formula changes:

=HLOOKUP(G9, G2:J4, 3, FALSE)

  • G9 is where I typed the name this time.
  • G2:J4 is the table, but now Excel scans across the top row instead of down a column.
  • 3 tells Excel to return the value from the third row of the table, which again lands on the dish.
  • FALSE still means an exact match.

The part that actually confuses most people

The formulas themselves aren't hard to read once you've seen them. What gets people is picking the wrong one for how their sheet is laid out. Try using VLOOKUP on a horizontally arranged table, and you'll usually get an error because VLOOKUP searches vertically, not horizontally.

In real life, you rarely get to choose how a spreadsheet is organized. You inherit whatever someone else already built. Knowing both formulas means you're not stuck rebuilding their layout just to pull one piece of information.

Once you see the direction, choosing between VLOOKUP and HLOOKUP becomes pretty simple: look down, use VLOOKUP; look across, use HLOOKUP.

And yes, there's a newer function that makes both of them look a little old-fashioned. I will cover XLOOKUP later.

* If you're interested, you can check out my other post on How to Calculate Loan Payments in Excel Without AI.


* The top image is a screenshot of an Excel file.

Comments

Popular posts from this blog

Starting This Blog Again.

Where Do Army Helmets Go?— A Strange Equation Called "Military Math"

Slide for Life