Skip to content

VLOOKUP

VLOOKUP returns a value from the same row of a table, like the price for an item number. Learn the syntax and the typical errors, then practice with automatic feedback.

  • Free, no sign-up
  • No upload – files stay on your device
  • Phone, tablet and computer
Loading the spreadsheet …

VLOOKUP finds a value in the first column of a table and returns a value from the same row, such as the price for an item number or the department for an employee ID. The practice sheet above walks you through it with a product list and an order: exact match, copying the formula, a volume discount and catching #N/A.

How VLOOKUP works

The syntax is =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]).

Argument Meaning In the practice sheet
lookup_value What you’re looking for F2 (the item number)
table_array The table; the lookup value must be in its first column $A$2:$D$13
col_index_num Which column of the table to return, counted from the left 2 for the description, 4 for the price
range_lookup FALSE for an exact match, TRUE for an approximate match FALSE

So =VLOOKUP(F2,$A$2:$D$13,4,FALSE) looks for item 1003 in column A and returns the value from the 4th column of that row: $229.00.

Practice right here

The sheet above is a full spreadsheet with a lesson panel. Type your formula into the green cell and click Check. If something is off, you get a hint about the likely cause, for example a wrong column number or a table range that moved while copying. Hint and Show solution help if you get stuck, and Reset restores the sample data.

  1. Return the description for the item number in F2.
  2. Return the price with the same formula and a different column number.
  3. Copy both formulas down to row 6.
  4. Look up the volume discount with an approximate match.
  5. Replace #N/A with “not found” using IFERROR.

Exact match or approximate match

With FALSE, VLOOKUP only returns a result when it finds the lookup value exactly. That’s what you want for item numbers, names and IDs. If the value isn’t there, you get #N/A, which is better than a wrong result.

With TRUE (or if you leave out the fourth argument), VLOOKUP returns the largest value that is less than or equal to the lookup value. That’s useful for tiers: in the practice sheet, an order of 12 units falls into the “from 10 units” tier and gets a 5% discount. The first column of the table must be sorted in ascending order for this to work.

Note: If you leave out the fourth argument, VLOOKUP uses an approximate match. Get into the habit of always writing FALSE when you need an exact match.

Common VLOOKUP errors

  • #N/A after copying: the table range moved down with the formula. Lock it with dollar signs, $A$2:$D$13; F4 adds them while you type.
  • #N/A even though the value is there: often one cell holds a number and the other holds the same digits as text, or there’s an extra space. Check both cells.
  • #REF!: the column number is larger than the table. A table from A to D has 4 columns.
  • Wrong value: the column number is counted from the first column of the table, not from column A of the sheet.
  • Values to the left: VLOOKUP can only return columns to the right of the lookup column. For a lookup to the left, use XLOOKUP or INDEX and MATCH.

To hide #N/A for values that really don’t exist, wrap the formula in IFERROR: =IFERROR(VLOOKUP(F6,$A$2:$D$13,2,FALSE),"not found").

VLOOKUP in Excel

In Excel, you can type the formula directly or find the function under Formulas → Lookup & Reference. In the Spreadsheet Editor, it’s under Formulas in the lookup category, or you can use the function wizard. On a Mac, Excel uses Command+T instead of F4 for the dollar signs.

Frequently asked questions

What does the “V” in VLOOKUP stand for?

Vertical. The function searches down the first column of a table. Its sibling HLOOKUP searches across the first row.

Why does my formula return #N/A?

Either the value really isn’t in the first column of the table, or the table range shifted when you copied the formula. Lock it with $ signs and check for numbers stored as text or extra spaces.

Can VLOOKUP return several columns at once?

Not with one formula. Write one formula per column and change only the column number, as you do in tasks 1 and 2 of the practice sheet.

Should I still learn VLOOKUP?

Yes. It’s in countless existing workbooks and works in every version. For new workbooks, XLOOKUP is often more convenient, but older versions don’t support it.

Microsoft Excel is a trademark of Microsoft Corporation. The Spreadsheet Editor is not affiliated with Microsoft.