VLOOKUP searches the first column of a range for a value and returns something from the same row. To get the name for the staff ID in G2, type =VLOOKUP(G2,A2:E7,2,FALSE). Excel looks down column A, finds the row, and returns the entry in column 2 of the range. The FALSE at the end forces an exact match, which is what you want almost every time.
Functions
VLOOKUP Function in Excel: Syntax, Examples, Errors
Try this now
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Year | ||
| 2 | Ike | 2008 | ||
| 3 | Sandy | 2012 | ||
| 4 | Harvey | 2017 | ||
| 5 |
You are typing into D5. Refer to the cells that hold the data.
Ready to practice?
Apply what you just learned with interactive exercises.
This guide covers the Excel VLOOKUP function from the first formula to the traps that cause wrong answers: the left-column rule, approximate match for tiers, lookups from another sheet, matching on two criteria with a helper column, the errors you will see and when to switch to XLOOKUP. Every VLOOKUP example runs on one staff sheet, so you can type it in and compare each result.
TL;DR
- The VLOOKUP formula is =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]).
- The value you search for must be in the first column of table_array. VLOOKUP cannot look to the left of it.
- The column number counts from the first column of your range, not from column A of the sheet.
- Always type FALSE (or 0) for an exact match. Leave it off and Excel does an approximate match that can return a wrong row without any error.
- For two criteria, join them into a helper column and look up the joined value, or use SUMIFS when the answer is a number.
- If everyone has a current Excel, XLOOKUP avoids most VLOOKUP mistakes.
Table of Contents
- The sample data used in every example
- VLOOKUP syntax and arguments
- VLOOKUP examples from simple to advanced
- Exact match or approximate match
- VLOOKUP with multiple criteria
- VLOOKUP from another sheet
- VLOOKUP vs XLOOKUP, HLOOKUP and INDEX MATCH
- Which Excel versions have VLOOKUP
- VLOOKUP errors and how to fix them
- What learners get wrong
- A worked job: pay review lookup
- Practice VLOOKUP
- FAQ
- Sources
The sample data used in every example
You are an HR clerk with a small staff list. Type this into a blank sheet starting at A1.
| Row | A | B | C | D | E |
| 1 | ID | Name | Department | Grade | Monthly salary |
| 2 | 4101 | Lerato Dlamini | Finance | B | 42000 |
| 3 | 4102 | Pieter van Wyk | Logistics | C | 31500 |
| 4 | 4103 | Aisha Khan | Finance | A | 58000 |
| 5 | 4104 | Sipho Nkosi | Sales | B | 39000 |
| 6 | 4105 | Megan Jacobs | Sales | C | 33500 |
| 7 | 4106 | Johan Botha | Logistics | B | 36000 |
| Row | G | H |
| 1 | Staff ID | Name typed |
| 2 | 4104 | Megan Jacobs |
VLOOKUP syntax and arguments
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
| Argument | Required | What it does |
| lookup_value | Yes | The value to find. A cell, a number, or text in quotes. |
| table_array | Yes | The range that holds both the value you search for and the value you want back. |
| col_index_num | Yes | Which column of table_array to return. 1 is the first column of your range. |
| range_lookup | No | FALSE or 0 for an exact match. TRUE, 1 or left out for an approximate match. |
- The search always happens in the first column of table_array. If your lookup value lives in column C, the range must start at C.
- col_index_num counts inside the range. In B2:E7, column B is 1, C is 2, D is 3 and E is 4. Counting from the sheet's column A is the classic wrong turn.
- range_lookup defaults to approximate. This is a dangerous default, so VLOOKUP formulas in real workbooks nearly always end in FALSE.
VLOOKUP examples from simple to advanced
Each example below runs on the staff sheet and shows the result you should see, so you can compare it with your own. Every lookup has the same four parts: the value, the range, the column number and the match type. If you want a slower click-by-click walkthrough of the dialog box, our step-by-step VLOOKUP tutorial covers that. This page is the reference.
How to find a name from an ID
The classic sample: the ID is in G2 and you want the person's name.
=VLOOKUP(G2,A2:E7,2,FALSE)
Excel finds 4104 in A5, the fourth row of the range, and returns column 2 of that row, which is Sipho Nkosi.
How to return a different column
Only the column number changes when you want another field for the same person.
=VLOOKUP(G2,A2:E7,3,FALSE) returns Sales, the department.
=VLOOKUP(G2,A2:E7,5,FALSE) returns 39000, the monthly salary.
Hardcoding 5 works until someone inserts a column. A sturdier version asks MATCH to find the column by its heading:
=VLOOKUP(G2,A1:E7,MATCH("Monthly salary",A1:E1,0),FALSE)
This still returns 39000, and it keeps working when columns move because MATCH recalculates the position. Notice the range now starts at row 1 so the heading row is included for MATCH.
How to look up by name text
Lookups by text work the same way, with two cautions. The text goes in quotes, or comes from a cell. And the name must be in the first column of the range, so start the range at column B:
=VLOOKUP(H2,B2:E7,4,FALSE)
H2 holds Megan Jacobs, which sits in the first column of B2:E7. Column 4 of that range is E, so the result is 33500.
The text must match the cell as written. =VLOOKUP("Megan",B2:E7,4,FALSE) returns #N/A because no cell says only "Megan". If you only know the start of a name, add a wildcard: =VLOOKUP("Sip*",B2:E7,4,FALSE) returns 39000. The * stands for any number of characters, and our wildcard characters guide lists the others.
Why VLOOKUP cannot look left
Suppose you hold the name in H2 and want the ID, which sits to the left of it. This fails:
=VLOOKUP(H2,A2:B7,1,FALSE)
Excel searches column A, where names do not appear, and returns #N/A. The fix is not a smarter column number. VLOOKUP only returns columns at or to the right of the search column. Use INDEX and MATCH instead:
=INDEX(A2:A7,MATCH(H2,B2:B7,0))
That returns 4105. Our INDEX MATCH guide explains the pair, and XLOOKUP does the same job as =XLOOKUP(H2,B2:B7,A2:A7).
How to find the first row for a department
Departments repeat, so VLOOKUP returns the first one it meets. Start the range at the department column:
=VLOOKUP("Finance",C2:E7,3,FALSE)
It returns 42000, the salary of Lerato Dlamini in row 2, because she appears before Aisha Khan. When duplicates matter, add a second criterion (see below) or use a function that can list every match, such as FILTER.
How to show a message instead of #N/A
An ID that is not on file returns #N/A:
=VLOOKUP(4199,A2:E7,2,FALSE)
Wrap it in IFNA to show a message for that case only:
=IFNA(VLOOKUP(4199,A2:E7,2,FALSE),"Not on file")
The result is "Not on file". IFERROR does the same job but also hides a #REF! caused by a bad column number, so you would never learn the formula is broken. Prefer IFNA when a missing item is the only thing you expect to go wrong:
=IFERROR(VLOOKUP(4199,A2:E7,2,FALSE),"Not on file") shows the same text but swallows every error type.
Exact match or approximate match
The fourth argument decides how the search works, and mixing the modes up produces the quiet kind of error.
Exact match (FALSE or 0) looks for the value and returns #N/A if it is missing. Use it for IDs, names, codes and anything where the answer should exist.
Approximate match (TRUE, 1 or omitted) looks for the largest value that is less than or equal to your lookup value. It needs the first column sorted from smallest to largest. Use it for bands such as commission rates, grades and tax brackets.
Here is a commission table. Type it into a new area starting at A1, with the sales figure in D2.
| Row | A | B | C | D |
| 1 | Sales from | Rate | Sales | |
| 2 | 0 | 0% | 135000 | |
| 3 | 50000 | 2% | ||
| 4 | 100000 | 4% | ||
| 5 | 200000 | 6% |
=VLOOKUP(D2,A2:B5,2,TRUE)
135000 is not in the list. The largest value that does not exceed it is 100000, so the formula returns 0.04, or 4% once the cell is formatted as a percentage. Leaving off TRUE gives the same result, =VLOOKUP(D2,A2:B5,2), because approximate is the default. Switch to FALSE and the same lookup returns #N/A, since 135000 is not listed exactly:
=VLOOKUP(D2,A2:B5,2,FALSE)
Two edge cases to remember:
- A value smaller than the first row returns #N/A. =VLOOKUP(-5,A2:B5,2,TRUE) has nowhere to land.
- A value larger than the last row returns the last row. =VLOOKUP(250000,A2:B5,2,TRUE) returns 0.06.
If the first column is not sorted, an approximate match can return a wrong row with no warning at all. Sort first, or use exact match, or use =XLOOKUP(D2,A2:A5,B2:B5,,-1), which does not need a sorted list.
VLOOKUP with multiple criteria
VLOOKUP checks one column, so to match on two things you build a single key that joins them. This is the standard way to do VLOOKUP with multiple criteria.
Here is a sales table where the first column is a helper key. Column A holds the formula, copied down.
| Row | A | B | C | D |
| 1 | Key | Region | Product | Units |
| 2 | North-Tea | North | Tea | 120 |
| 3 | North-Coffee | North | Coffee | 95 |
| 4 | South-Tea | South | Tea | 80 |
| 5 | South-Coffee | South | Coffee | 140 |
| 6 | East-Tea | East | Tea | 60 |
| 7 | East-Coffee | East | Coffee | 75 |
- Build the key. In A2 type =B2&"-"&C2 and fill it down. The dash keeps two different pairs from producing the same text, such as "A" with "BC" and "AB" with "C".
- Look up the joined value. In H2 type =VLOOKUP(F2&"-"&G2,A2:D7,4,FALSE). It builds "South-Coffee", finds it in A5 and returns column 4, which is 140.
When the value you want is a number you are adding up, skip the helper column altogether:
=SUMIFS(D2:D7,B2:B7,F2,C2:C7,G2)
That also returns 140 and accepts as many criteria as you like. Our SUMIFS guide shows the pattern. Keep VLOOKUP for text answers such as a name, a status or a category.
VLOOKUP from another sheet
Looking up from another sheet changes only the range. Click the other sheet's tab while you build the formula and Excel writes the sheet name for you. If your rate card sits on a sheet called Rates with IDs in column A and the monthly rate in column C, the formula on the staff sheet looks like this:
=VLOOKUP(A2,Rates!$A:$D,3,FALSE)
The range Rates!$A:$D is the whole of columns A to D on the Rates sheet, with the dollar signs locking it when you fill down. If the sheet name contains a space, Excel wraps it in single quotes, as in 'Rate Card'!$A:$D. The same rules apply as on one sheet: the ID must be in the first column of the range, and the column number counts inside the range. Our absolute reference guide explains why the dollar signs matter.
The most common reason a VLOOKUP from another sheet fails is a mismatch in how the key is stored. One sheet has the ID as a number and the other as text. Check both columns with ISNUMBER before you hunt anywhere else.
VLOOKUP vs XLOOKUP, HLOOKUP and INDEX MATCH
| Question | VLOOKUP | XLOOKUP | INDEX MATCH | HLOOKUP |
| Direction | Down a column | Either | Either | Along a row |
| Return left of the key | No | Yes | Yes | Not applicable |
| Default match | Approximate | Exact | Exact with 0 | Approximate |
| Survives an inserted column | Only with a MATCH column number | Yes | Yes | Only with a MATCH row number |
| Excel versions | All | 2021 and later, Microsoft 365 | All | All |
Which Excel versions have VLOOKUP
VLOOKUP has been in Excel for decades and works in every desktop version, Excel for Microsoft 365, Excel for the web and Excel for Mac. A workbook that uses it opens correctly almost anywhere, which is the strongest argument for it. The one limit worth knowing from Microsoft's documentation is that the lookup value cannot be longer than 255 characters; a longer one returns #VALUE!.
VLOOKUP errors and how to fix them
Every row below can be reproduced on the staff sheet.
| Error | Cause | Fix |
| #N/A | The value is not in the first column, has a hidden space, or is a text number against a real number. | Check spelling and spaces with TRIM. Check both sides are numbers. Confirm the range starts at the lookup column. |
| #REF! | col_index_num is larger than the number of columns in the range, as in =VLOOKUP(G2,A2:E7,6,FALSE). | Count the columns of the range and use a number within it. |
| #VALUE! | col_index_num is below 1, as in =VLOOKUP(G2,A2:E7,0,FALSE), or the lookup value is over 255 characters. | Use 1 or higher. |
| #NAME? | Text typed without quotes, or the function name misspelled. | Put text in quotes or point to a cell. |
| A wrong value, no error | The fourth argument was left off and the lookup became approximate. | Type FALSE. |
Trailing spaces cause the same symptom with names. =VLOOKUP("Lerato Dlamini ",B2:E7,4,FALSE), with a space at the end, returns #N/A. Wrap the lookup value in TRIM, as in =VLOOKUP(TRIM(H2),B2:E7,4,FALSE), when the input comes from people typing or from a pasted export.
What learners get wrong
Between 26 September and 3 November 2026, learners made 16,784 first attempts across our VLOOKUP Function lesson, and 61.6% were right. VLOOKUP Function 2 logged 2,659 first attempts with 74.7% right, VLOOKUP Approximate Match logged 2,039 with 73.4% right, and VLOOKUP with Multiple Criteria logged 1,093 with 78.9% right. A first attempt is the first check of a screen in a page view, not a head count of people. Four patterns explain most of the wrong answers.
1. A number typed as text. The hardest screen in the main lesson asked for the tenant in unit 254. Only 39.3% of 1,576 first attempts were right. The two most common wrong answers were =vlookup("254",a1:b4,2,0), 275 times, and =vlookup("254",a:b,2,0), 254 times. Both put quotes around a number. The correct formula is =vlookup(254,a:b,2,0), because the unit numbers are numbers. On our staff sheet, =VLOOKUP("4104",A2:E7,2,FALSE) fails for the same reason. Quote text, not numbers.
2. A column number counted from the wrong place. On the screen asking for Patrick's major in the range B:C, only 43.2% of 1,485 first attempts were right, and =vlookup("Patrick",b:c,3,0) appeared 144 times. The range B:C holds two columns, so the major is column 2, and 3 points past the end. Excel returns #REF!. The same happened with =vlookup(95,a:b,3,0), 93 times, where the instruction was to use A:B. Count columns inside the range you typed, starting at 1.
3. A range that starts in the wrong column. One screen gave a salinity of 1.2 and asked for the area of that lake. Only 45.3% of 274 first attempts were right. Answers such as =vlookup(1.2,a:c,3,false) and =vlookup(1.2,a:c,1,0) search column A for 1.2, which is not there. The salinity sits in column C, so the range must begin at C: =vlookup(1.2,c:d,2,false). The first column of the range must be the column that holds the value you know.
4. The fourth argument forgotten, or the text altered. On the approximate-match lesson, =vlookup(e2,a:c,3) and =vlookup(1,a:c,3) picked column 3 where column 2 was needed. Leaving off the fourth argument was harmless there, because approximate match was what the screen asked for. On the exact-match lake screens, =vlookup("Malawi",a:d,4) skipped it as well, which silently switches to approximate matching. Another group typed the full name, as in =vlookup("Lake Superior",a:c,3,0), when the list held only "Superior". The lookup text has to match the cell as it is written.
A worked job: pay review lookup
Your manager sends a list of staff IDs and wants name, department and salary for each, plus a flag for anyone missing. Use the staff sheet from the top of this page.
- Set up the lookup. Put the ID to check in G2. In I2 write =IFNA(VLOOKUP(G2,A2:E7,2,FALSE),"Not on file") for the name. For 4104 you get Sipho Nkosi.
- Pull the other fields from the same ID. In J2 use =VLOOKUP(G2,A2:E7,3,FALSE) for the department, which returns Sales, and in K2 use =VLOOKUP(G2,A2:E7,5,FALSE) for the salary, which returns 39000. Lock the range as $A$2:$E$7 before you fill down to the other staff IDs.
- Catch bad IDs before they reach payroll. Test one ID that does not exist, such as 4199. The IFNA version shows "Not on file". If that same ID were run through =VLOOKUP(4199,A2:E7,2) with no fourth argument, it would return Johan Botha instead. Running one bad ID through every new lookup takes ten seconds and tells you whether you are on exact match.
- Check the column numbers after any change. If a column is inserted before Monthly salary, the 5 in K2 now points at the wrong field. Swap it for MATCH("Monthly salary",A1:E1,0) or move to XLOOKUP.
Practice VLOOKUP
You learn this function by typing it. The page already carries an exercise from Practice Lesson 11, so type the formula there rather than read on.
Then continue with Practice Lesson 71 for lookups where the range has to start at a different column, Practice Lesson 80 for approximate match and bands, and Practice Lesson 95 for matching on two criteria with a helper column. If a formula comes back with the wrong answer, compare it with the four patterns above before you retry.
FAQ
How do you write a VLOOKUP formula in Excel?
Type =VLOOKUP(, then the value to find, the range, the column number to return and FALSE. For example, =VLOOKUP(G2,A2:E7,2,FALSE) searches the first column of A2:E7 for the value in G2 and returns the second column of that row. The search value must be in the first column of your range.
What does the 4th argument in VLOOKUP mean?
The fourth argument, range_lookup, sets the match type. FALSE or 0 means exact match: return #N/A if the value is absent. TRUE, 1 or leaving it blank means approximate match: find the largest value not above yours, which needs a sorted first column. For IDs and names, always use FALSE.
Why is my VLOOKUP returning #N/A when the value exists?
The usual causes are a number stored as text on one side, a trailing space, or a range that does not start at the lookup column. Test with ISNUMBER on both cells, wrap the lookup value in TRIM, and check that the first column of the range is the one holding your value.
Can VLOOKUP look to the left?
No. VLOOKUP always searches the first column of the range and can only return that column or those to its right. To return something on the left, use INDEX and MATCH, or XLOOKUP in a version that has it. Rearranging the columns so the key comes first also works.
How do you use VLOOKUP with two criteria?
Build a helper column that joins the two fields, such as =B2&"-"&C2, put it first in the range, then look up the joined text with =VLOOKUP(F2&"-"&G2,A2:D7,4,FALSE). For a numeric answer such as units or sales, SUMIFS accepts several criteria directly, so no helper column is needed at all.
How do you use VLOOKUP from another sheet?
Write the formula as usual and choose the range by clicking on the other sheet, so Excel inserts the sheet name: =VLOOKUP(A2,Rates!$A:$D,3,FALSE). Quote names with spaces. The ID must be in the first column of the range, and both sheets must store the key the same way.
Should I use VLOOKUP or XLOOKUP?
Use XLOOKUP when everyone who opens the file has Microsoft 365, Excel 2021 or later. It matches exactly by default, looks left and right, and does not need a column number. Use VLOOKUP when the file has to work in Excel 2019 or earlier, or when you maintain a sheet that already uses it.
Sources
Keep going
Guides people read next.

WEEKDAY Function in Excel: Syntax, Examples and Day Names
Learn how the Excel WEEKDAY function works, which return_type to pick, how to get day names, flag weekends and fix errors, with copy-ready formulas.
15 min
CHOOSECOLS Function in Excel: Syntax, Examples, Fixes
Learn how the Excel CHOOSECOLS function works, with CHOOSEROWS too: syntax, negative indexes, FILTER combos, version support and fixes for #VALUE! and #SPILL!.
16 minExcel FIND Function: Syntax, Examples and Fixes
Use the Excel FIND function to get a character's position, split text at @ or hyphens, find the second match, and fix #VALUE! errors.
16 min