EXAMPLE + HANDS-ON PRACTICE
VLOOKUP practice with expense data
VLOOKUP answers a question such as “How much did we pay Harbor Desk?” It finds a value in the first column of a table and returns a value from another column in the same row.
A small worked example
Column A holds the merchant, column B the category and column C the amount:
| Row | A: Merchant | B: Category | C: Amount |
|---|---|---|---|
| 2 | Mint Post | Shipping | 15 |
| 3 | Harbor Desk | Office | 220 |
| 4 | Blue Lantern | Software | 89 |
=VLOOKUP("Harbor Desk",A2:C4,3,FALSE)The result is 220. VLOOKUP looks for Harbor Desk in column A, moves to the 3rd column of the table (C) in the same row, and returns its value.
The four arguments
- Lookup value: what to find, typed in quotes or as a cell such as
E2. - Table: the range to search. The lookup value must be in its first column.
- Column number: which column of the table to return, counting from 1.
- FALSE: exact match. Leave it out and Excel guesses on a sorted list, which causes wrong answers.
Why you get #N/A
- Not in the first column: the table must start at the column you search.
- Spelling or extra spaces: “Harbor Desk ” with a trailing space does not match.
- Numbers stored as text: 1001 and “1001” are different to Excel.
XLOOKUP: the simpler version
In Excel 365 and 2021 or newer, XLOOKUP needs no column number and can look left:
=XLOOKUP("Harbor Desk",A2:A4,C2:C4)
Try it yourself
In the simulator, use VLOOKUP to find a merchant’s amount in an eight-row ledger, then look up a status from a cell, then use XLOOKUP. Your formula is checked instantly, and changed numbers make sure it really works.
Examples use English function names and comma separators. Your Excel language settings may use different names or separators.
Product reference: Microsoft documentation. Teaching examples and fictional data by StatementNest.