what is the difference between vlookup and hlookup?
VLOOKUP looks vertically down columns, while HLOOKUP looks horizontally across rows.
🔎 Quick Scoop: Core Difference
- VLOOKUP (Vertical Lookup)
- Searches for a value in the first column of a table.
- Then returns a value from a specified column in the same row.
* Use it when your data is arranged in **columns** (items listed top to bottom).
- HLOOKUP (Horizontal Lookup)
- Searches for a value in the top row of a table.
- Then returns a value from a specified row in the same column.
* Use it when your data is arranged in **rows** (items listed left to right).
Mini View: Side‑by‑Side
html
<table>
<thead>
<tr>
<th>Feature</th>
<th>VLOOKUP</th>
<th>HLOOKUP</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data orientation</td>
<td>Vertical – works with columns[web:1][web:7]</td>
<td>Horizontal – works with rows[web:1][web:3][web:7]</td>
</tr>
<tr>
<td>Where it searches first</td>
<td>First column of the table[web:1][web:9]</td>
<td>Top row of the table[web:1][web:9]</td>
</tr>
<tr>
<td>How it returns a value</td>
<td>From a given column in the same row[web:1][web:5]</td>
<td>From a given row in the same column[web:1][web:5]</td>
</tr>
<tr>
<td>Typical use case</td>
<td>Product IDs in column A, get price from column C[web:5][web:9]</td>
<td>Months in top row, get sales from a specific row[web:6][web:9]</td>
</tr>
<tr>
<td>Syntax pattern</td>
<td>=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])[web:2][web:4]</td>
<td>=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])[web:2][web:4][web:6]</td>
</tr>
</tbody>
</table>
How They Work (Simple Story Style)
Imagine a classroom:
- In one school, all students’ names are listed down the left side of the board, and their scores are in columns to the right.
- To find “Ali” and then get his Math score from a column, you’d use VLOOKUP — you scan down until you find Ali, then move across to the Math column.
- In another school, subjects (Math, Science, English) are written across the top , and each row below holds different information (average score, top student, etc.).
- To find “Math” and then get the top score from a particular row, you’d use HLOOKUP — you scan across the top row, then move down to the right row.
When Should You Use Which?
Use VLOOKUP when:
- Your headers are at the top , and your key identifiers are in the first column.
- You’re pulling related info from columns in the same row (e.g., product ID → price, category).
Use HLOOKUP when:
- Your headers are in the first row , and data runs across.
- You’re pulling related info from rows in the same column (e.g., month → sales in a specific row).
A Quick Example
- VLOOKUP example :
- Table: Column A has employee IDs, column B has names, column C has salaries.
- Task: Given an employee ID, return the salary.
- Use VLOOKUP to search the ID in column A and return the salary from column C.
- HLOOKUP example :
- Table: Row 1 has month names (Jan, Feb, Mar…), row 2 has total sales for each month.
- Task: Given a month, return the sales figure.
- Use HLOOKUP to search the month in row 1 and return the value from row 2.
Tiny TL;DR
- VLOOKUP = vertical search down a column, return from a column in the same row.
- HLOOKUP = horizontal search across a row, return from a row in the same column.
Information gathered from public forums or data available on the internet and portrayed here.