How to Use VLOOKUP in Excel (With Examples and Fixes)

To use VLOOKUP in Excel, click the cell where you want the answer, type =VLOOKUP(, then give it four things separated by commas: the value to find, the table to search, the column number to bring back, and FALSE for an exact match. A finished formula looks like =VLOOKUP(E2,$A$2:$C$8,3,FALSE). Press Enter and Excel returns the matching value from the same row.

VLOOKUP works the same way in Excel for Microsoft 365 (Windows and Mac), Excel 2024, 2021, 2019, 2016, and Excel for the web. If you have Microsoft 365, Excel 2021, or Excel 2024, you also have XLOOKUP, a newer function that fixes several of VLOOKUP’s quirks. VLOOKUP is still worth knowing because it runs in every current version and appears in countless shared workbooks.

What’s in this guide

How a VLOOKUP formula reads

The “V” stands for vertical. VLOOKUP goes down the first column of a range until it finds your value, then moves across that row to the column you ask for. The full syntax is:

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

Argument What it means Example
lookup_value The thing you’re searching for. Usually a cell reference, but it can be typed text in quotes or a number. E2
table_array The block of cells to search. The lookup value must be in the first (leftmost) column of this block, and the answer must be somewhere to its right. $A$2:$C$8
col_index_num Which column of that block to return, counting from 1 at the block’s left edge, not from column A of the sheet. 3
range_lookup Optional. FALSE (or 0) means exact match. TRUE (or 1) means approximate match. If you leave it out, Excel uses TRUE. FALSE

That last default trips up a lot of people. If you skip the fourth argument, Excel quietly performs an approximate match and can hand you a plausible-looking but wrong result. For looking up IDs, names, and product codes, always type FALSE.

Advertisements

The sample data used below

Picture a small product list in columns A through C, with an order form beside it in columns E and F. You want the price for each Item ID on the order form to fill in automatically.

A: Item ID B: Product C: Price E: Order ID F: Price
1 Item ID Product Price Order ID Price
2 P-101 Desk lamp 24.99 P-104 ?
3 P-102 Monitor stand 39.50 P-101 ?
4 P-103 USB hub 18.75 P-107 ?
5 P-104 Keyboard 49.00 P-110 ?
6 P-105 Mouse pad 9.99
7 P-106 Webcam 64.00
8 P-107 Headset 79.95

The lookup column (Item ID) is the leftmost column of the price list, and the column you want back (Price) sits to its right. That layout is what VLOOKUP needs.

Build your first VLOOKUP step by step

These steps use Excel for Microsoft 365 on Windows, but the formula is typed the same way on a Mac and in Excel for the web.

  1. Select the answer cell. Click F2, the first empty Price cell on the order form.
  2. Start the function. Type =VLOOKUP(. A small tooltip appears under the cell showing the four arguments, with the one you’re working on in bold.
  3. Pick the lookup value. Click cell E2 (the Order ID P-104), then type a comma. The formula now reads =VLOOKUP(E2,.
  4. Select the table. Drag across A2:C8. Then press F4 once so the range becomes $A$2:$C$8. The dollar signs lock the range so it doesn’t slide down when you copy the formula later. On a Mac, press Command+T or Fn+F4 instead of F4. Type a comma.
  5. Enter the column number. Price is the third column of A:C, so type 3 and a comma.
  6. Choose exact match. Type FALSE. Excel may show a short list offering TRUE and FALSE; you can double-click FALSE instead of typing it. Type a closing parenthesis.
  7. Press Enter. Your formula is =VLOOKUP(E2,$A$2:$C$8,3,FALSE) and F2 shows 49.00, the price of the keyboard.
  8. Copy it down. Click F2 again, then drag the small square at its bottom-right corner (the fill handle) down to F5, or double-click the fill handle. Each row now looks up its own Order ID while still searching the same locked table.

After filling down, you’ll see 49.00, 24.99, 79.95, and then #N/A in F5. That #N/A is correct: P-110 isn’t in the price list. Further down you’ll see how to show a friendlier message instead.

Why the dollar signs matter

Without $ signs, copying the formula from F2 to F3 changes the table to A3:C9, then A4:C10, and so on. The top rows drop out of the search, and lookups that should work start returning #N/A. Locking the table with F4 before you fill down prevents that. The lookup value (E2) should stay unlocked so it moves to E3, E4, and E5 as intended.

A tidier option: turn the list into a table

If you click inside the price list and press Ctrl+T (or go to Insert > Table, which also works on a Mac and in Excel for the web), Excel converts it into a formatted table. When you select that table in your VLOOKUP, Excel writes a name such as Table1 instead of cell addresses. A table reference doesn’t need dollar signs, and it grows automatically when you add new products at the bottom.

Use the Function Arguments box instead of typing

If you’d rather fill in labeled boxes, Excel has a guided form that previews the result before you commit.

  1. Click the answer cell, such as F2.
  2. Go to the Formulas tab and click Insert Function (the fx button to the left of the formula bar does the same thing).
  3. Type VLOOKUP in the search box, click Go, select VLOOKUP in the list, and click OK.
  4. Fill in the four boxes: Lookup_value (E2), Table_array ($A$2:$C$8), Col_index_num (3), and Range_lookup (FALSE). The current result appears near the bottom of the box as you type.
  5. Click OK.

On a Mac, Insert Function opens the Formula Builder pane on the right side of the window, which has the same four fields. Excel for the web also offers Insert Function on its Formulas tab.

Look up data on another sheet or workbook

Price lists often live on their own tab. You don’t need to type the sheet name yourself.

  1. Start the formula on your order sheet: =VLOOKUP(E2,
  2. Click the tab that holds the price list (for example, Products) and select the table there.
  3. Excel writes the sheet name for you, such as Products!A2:C8. Press F4 to lock it, then finish the formula: =VLOOKUP(E2,Products!$A$2:$C$8,3,FALSE)

If the sheet name contains spaces, Excel wraps it in single quotes, like 'Price List'!$A$2:$C$8. For a different workbook, open both files first, then click across to the other file while building the formula. Excel adds the file name in square brackets. If the source file is later closed, the formula keeps its last results and shows the full file path. If you’re used to Google Sheets, the idea is the same as pulling data from another sheet in Google Sheets.

When to use TRUE (approximate match)

Approximate match is the right choice when you’re placing a number into a band, such as a grade scale, shipping tier, or commission rate. With TRUE, VLOOKUP looks for your number and, if it isn’t there, settles on the largest value that is less than or equal to it.

H: Minimum score I: Grade
2 0 F
3 60 D
4 70 C
5 80 B
6 90 A

With a score of 85 in cell K2, =VLOOKUP(K2,$H$2:$I$6,2,TRUE) returns B. There’s no 85 in column H, so Excel uses 80, the next lower step.

Two rules make this work. First, the first column must be sorted smallest to largest (on the Data tab, click Sort A to Z or Sort Smallest to Largest). If it isn’t sorted, the results can be wrong without any error showing. Second, each row should hold the start of a band, beginning with the lowest possible value. A score lower than the first entry returns #N/A.

Wildcards, friendly error messages, and more

Match part of a word

With exact match (FALSE), text lookups can include wildcards. An asterisk * stands for any number of characters and a question mark ? stands for one character. =VLOOKUP("Web*",$B$2:$C$8,2,FALSE) finds the first product starting with “Web” (Webcam) and returns its price. To search for text that contains a word you’ve typed in G2, use "*"&G2&"*" as the lookup value. If you need to find an actual asterisk or question mark, put a tilde in front of it, like ~*.

Show a message instead of #N/A

Wrap the formula in IFNA to replace the error with something readable:

=IFNA(VLOOKUP(E2,$A$2:$C$8,3,FALSE),"Not in price list")

IFNA catches only the “not found” error, so a typo that causes #REF! or #NAME? will still show up and get noticed. IFERROR works the same way but hides every type of error, which can mask real mistakes. Add these only once your lookup is working. Excel also flags formulas that return those errors with a green triangle, and the Error Checking dialog in Excel steps through each one so none are missed.

Pick the column by header name

A typed column number breaks if someone inserts a column inside the table: the 3 still points at the third column, which now holds something else. You can let MATCH find the column for you from the header row:

=VLOOKUP(E2,$A$2:$C$8,MATCH("Price",$A$1:$C$1,0),FALSE)

MATCH returns 3 because “Price” is the third header, and it updates if the columns move.

Look up two conditions at once

VLOOKUP accepts only one lookup value. If you need, say, first name and last name together, add a helper column to the left of your data with a formula such as =B2&" "&C2, then look up the combined text, for example =VLOOKUP(G2&" "&H2,$A$2:$E$50,5,FALSE).

What VLOOKUP can’t do

  • It can’t look left. The answer column must be to the right of the lookup column. If your IDs are in column C and names are in column A, either move the columns or use XLOOKUP or INDEX and MATCH.
  • It returns only the first match. If an ID appears twice, you get the row nearest the top. Clean up duplicates first if each ID should be unique.
  • It ignores capitalization. “mia” and “MIA” count as the same value.
  • Typed column numbers don’t adjust when columns are inserted or deleted inside the table (the MATCH trick above solves this).
  • The default is approximate match. Leaving off FALSE is the most common cause of wrong answers.

If your version supports it, XLOOKUP avoids most of these limits:

=XLOOKUP(E2,$A$2:$A$8,$C$2:$C$8,"Not found")

It uses separate lookup and return ranges, so it can look in either direction, and it defaults to exact match. In Excel 2019 and Excel 2016, use INDEX and MATCH instead: =INDEX($C$2:$C$8,MATCH(E2,$A$2:$A$8,0)).

Fixing #N/A, #REF!, and wrong answers

What you see Likely cause How to fix it
#N/A, but the value is clearly in the list Hidden spaces before or after the text, often in data pasted from another system. Clean the column with =TRIM(A2) in a helper column, then paste the results back as values. Find and Replace (replace a space with nothing) also works for codes that should never contain spaces.
#N/A on number lookups One side is a real number and the other is a number stored as text. A small green triangle in the cell corner is the clue. Select the text-numbers, click the warning icon, and choose Convert to Number, or use Data > Text to Columns > Finish on the column.
#N/A for every row after the first The table range wasn’t locked, so it slid down as you filled the formula. Edit the first formula, press F4 on the table range, and fill down again.
#N/A when the value really isn’t there Expected behavior. Wrap the lookup in IFNA to show a message.
#REF! The column number is larger than the number of columns in the table. Asking for column 4 of A:C causes this. Use a smaller number or widen the table range.
#VALUE! The column number is less than 1. Use 1 or higher.
#NAME? The function name is misspelled, or text in the formula is missing its quotation marks. Check the spelling and put typed text inside straight double quotes, like "P-104".
A real value, but the wrong one The fourth argument is TRUE or missing, so Excel did an approximate match on unsorted data. Change the last argument to FALSE.
The formula appears as text in the cell The cell was formatted as Text before you typed the formula. Set the cell to General on the Home tab’s number format list, click into the formula bar, and press Enter.
#SPILL! in Microsoft 365 The lookup value is a whole column (such as A:A), so Excel tries to return many results at once. Point at one cell, like E2, or put @ before the column reference.

Microsoft’s VLOOKUP function reference lists these problems too, and its guide to correcting #N/A errors goes deeper on number formats and extra spaces.

How to check the result

Spot-check one or two rows by hand: find the Order ID in the price list and confirm the price matches. To see exactly what a formula is doing, click the cell, then go to Formulas > Evaluate Formula and click Evaluate to step through it. If you want the prices to stay put even after the source list changes, copy the results and use Paste Special > Values. Press Ctrl+Z right away if you paste over the wrong cells.

Common VLOOKUP questions

Is VLOOKUP case-sensitive?

No. VLOOKUP treats uppercase and lowercase letters as identical, so “keyboard” and “KEYBOARD” match the same row. A case-sensitive lookup needs a different formula built with the EXACT function.

Can VLOOKUP return more than one result for the same value?

No. It always stops at the first matching row from the top. To return every match, use the FILTER function in Microsoft 365, Excel 2021, or Excel 2024.

Should I use FALSE or 0?

Either one. Excel treats 0 the same as FALSE (exact match) and 1 the same as TRUE (approximate match).

Does VLOOKUP work in Excel for the web and on a Mac?

Yes. The function and its arguments are identical. The only differences are keyboard shortcuts on a Mac (Command+T or Fn+F4 to lock a reference) and where the guided Formula Builder appears.

What’s the difference between VLOOKUP and HLOOKUP?

VLOOKUP searches down the first column of a table. HLOOKUP searches across the first row and returns a value from a row below it. Use HLOOKUP when your labels run across the top rather than down the side.

Why did my lookup break after I added a column?

The column number in the formula is fixed. Insert a column inside the table and that number now points at a different column. Update the number, use the MATCH version shown earlier, or switch to XLOOKUP.

Can VLOOKUP add up the values it finds?

Not by itself; it returns one value per formula. You can wrap several VLOOKUPs in a sum, or use SUMIF when you want totals for a category. For simple totals of a filled-in column, the steps in summing a column in Excel apply to your VLOOKUP results too.

Where to go from here

Try the price-list example on a blank sheet, then swap in your own data and change only the column number. Once exact-match lookups feel routine, try the IFNA wrapper and the cross-sheet version. If you have Microsoft 365, writing the same lookup with XLOOKUP is a good next exercise, since it uses the same idea with fewer rules to remember.

Advertisements