Blog
How to Use VLOOKUP in Excel: Exact Match and Other Sheets
VLOOKUP searches the first column of a table for a value and returns a value from another column in the same row. In a gradebook, it is how a student ID from a quiz export becomes a name and a homeroom; in a personal budget, it is how a store name becomes a spending category. Typing homerooms next to 200 quiz scores by hand takes an hour and gets a line or two wrong; one filled-down VLOOKUP does it in a minute. This guide covers how to use VLOOKUP in Excel from the four arguments to other sheets, grading scales and the alternatives.
The four VLOOKUP arguments
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
The Microsoft Learn reference for VLOOKUP defines them this way:
- lookup_value: the value to search for in the first column of the table, typed in or referenced from a cell, such as a student ID or employee ID.
- table_array: two or more columns of data. The first column holds the values you search. Uppercase and lowercase text are treated as equal.
- col_index_num: which column of the range to return, counted inside the range, not by sheet letter. On a range C:F, column C is 1 and F is 4. A number below 1 returns #VALUE!, and one larger than the range width returns #REF!.
- range_lookup: FALSE (or 0) finds exact matches only. TRUE, or leaving it out, returns the next largest value below the lookup value when there is no exact match, and requires the first column to be sorted ascending.

The formula above looks up the ID in A4 on the Employee_List sheet and returns the fifth column, Country. For codes and IDs, the fourth argument should always be FALSE. Leaving it out does not raise an error for a missing code; it quietly returns a neighboring row's value.
Looking up values on another sheet or workbook
To search another sheet, put the sheet name and an exclamation point before the range. While typing the formula, click the other sheet's tab and drag the range, and Excel writes SheetName!Range for you. Sheet names with spaces need single quotes: 'Student List'!$A$2:$D$500.

Here a lookup form returns the employee name from a separate list. Lock the range with F4 so every row searches the same block when you fill down.

Leave the lookup value relative, like A4, and each row finds its own ID. Lock it, like $A$4 in the first example, and every cell reads the same ID, which suits a form that spreads one record across several fields. To return a different field from the same range, change only the column number.

For another workbook, the file name goes in square brackets: =VLOOKUP(A2,'[Roster.xlsx]Students'!$A:$D,3,FALSE). The last results remain when the source is closed, but renaming or moving the file breaks the link. A list you use every day is easier to manage as a sheet in the same file.
Let MATCH find the column number
A hard-coded column number breaks the day someone inserts a column in the source list. Exports from a gradebook or student information system change column layout more often than anyone expects. Put MATCH in the column-number slot and VLOOKUP finds the column by its header:
=VLOOKUP($B2,Roster!$A:$H,MATCH("Homeroom",Roster!$A$1:$H$1,0),FALSE)
According to the Microsoft Learn reference for MATCH, MATCH returns the relative position of an item in a range, and a match type of 0 finds the first value exactly equal to the lookup value. Wherever "Homeroom" moves, the formula follows.
The same trick fills several columns at once. Give your result columns the same headers as the roster and use MATCH(D$1,Roster!$A$1:$H$1,0). One formula, filled right and down, pulls the right field into every cell.
Approximate match for grading scales
Approximate match is for "which bracket does this fall in". A grading scale lists the start of each bracket in ascending order: 0 is F, 60 is D, 70 is C, 80 is B, 90 is A. With =VLOOKUP(D2,Scale!$A$2:$B$6,2,TRUE), a score of 87 matches the largest value not above it, 80, and returns B. A score of exactly 80 also returns B, because an exact match wins. Unsorted brackets give wrong answers, and a value below the first bracket returns #N/A. Re-sort whenever you add a bracket. Brackets work the same way outside school, such as sorting monthly spending into budget bands. Everywhere else, use FALSE.
Wildcards and error handling
With exact match and a text lookup value, * stands for any sequence of characters and ? for one character. =VLOOKUP("*"&G2&"*",$A:$D,4,FALSE) returns the fourth column for the first name containing G2. Put a tilde before a literal asterisk or question mark.
When nothing matches, VLOOKUP returns #N/A. To show a blank in a report, use =IFNA(VLOOKUP(…),""). IFNA hides only #N/A, so a broken range still shows #REF!. If the list has the same key twice, VLOOKUP returns the first match, so check keys for duplicates. Persistent #N/A errors usually come from formatting and spaces; work through the checklist below.
👉 VLOOKUP Not Working? How to Fix #N/A, #REF! and #VALUE!
Worked example: grading a lab practical
A high school chemistry teacher records lab practical scores in a Scores sheet with period, student ID and score. The same workbook has a Roster sheet exported from the student information system (student ID, student name, homeroom, guardian email) and a Scale sheet with the grading brackets. This semester's practical has 214 rows across six periods.
She types Student Name, Homeroom and Guardian Email in D1:F1, matching the roster's headers, and enters =VLOOKUP($B2,Roster!$A:$D,MATCH(D$1,Roster!$A$1:$D$1,0),FALSE) in D2. Filling it two columns right and 214 rows down fills in every student. The lookup value locks only the column ($B2) and the header reference locks only the row (D$1), so each cell finds its own field.
Six rows return #N/A. Four have a trailing space after the student ID, fixed with a TRIM helper column. Two are students who enrolled this month and are not in the roster export yet; she downloads a fresh roster and the two rows fill in.
Next, letter grades. Column G gets =VLOOKUP(C2,Scale!$A$2:$B$6,2,TRUE) and column H flags retakes with =IF(C2<70,"Retake",""), so she can email those families from the Guardian Email column. She spot-checks the scores sitting exactly on a cutoff (70, 80 and 90) to confirm each landed in the higher bracket. The job that used to take an evening of copying now takes twenty minutes, most of it spent on the six exceptions. Before entering grades in the online gradebook she pastes the grade column as values, so a later change to the scale cannot rewrite grades that are already posted.
VLOOKUP vs INDEX/MATCH vs XLOOKUP
| VLOOKUP | INDEX/MATCH | XLOOKUP | |
|---|---|---|---|
| Return a column to the left | No | Yes | Yes |
| Default match | Approximate | Exact with match type 0 | Exact |
| Survives inserted columns | No, unless MATCH supplies the number | Yes | Yes |
| Available in | All versions | All versions | Microsoft 365, Excel 2021+ |
VLOOKUP only searches the first column and returns columns to its right. To find a student ID from a name that sits to its right, use =INDEX(Roster!$A:$A,MATCH(G2,Roster!$B:$B,0)). In Microsoft 365 and Excel 2021 or later, =XLOOKUP(G2,Roster!$B:$B,Roster!$A:$A,"Not found") is the simplest of all and sets the not-found text in the same formula. Excel 2019 and earlier show #NAME? for XLOOKUP, so use VLOOKUP or INDEX/MATCH in files you share with colleagues on older versions.
FAQ
Q. Can VLOOKUP return several columns at once?
Use matching headers and MATCH for the column number, then fill right. In Microsoft 365 you can also pass an array such as {2,3,4} as the column number to spill three columns from one formula.
Q. How do I look up a value based on two conditions, such as student and assignment?
Add a helper column at the left of the score table with =A2&"|"&B2, and look up the same combination. With XLOOKUP, =XLOOKUP(G2&H2,A:A&B:B,C:C) works without a helper column.
Q. What is the difference between VLOOKUP and HLOOKUP?
VLOOKUP searches down the first column (V for vertical); HLOOKUP searches across the first row (H for horizontal). Use HLOOKUP when the keys run across a header row, such as one column per week.
Q. The result looks like a number but will not add up.
The source list stores it as text. Convert the source column with Text to Columns, or wrap the formula in VALUE.
Fill in a score sheet with inline AI
inline AI opens the score workbook on your PC. Say "pull each student's name, homeroom and guardian email from Roster and the letter grade from Scale by student ID," and it writes lookups with the right ranges and match types, then sets aside the rows it could not match, such as trailing spaces or students missing from the roster.
Gradebooks and spreadsheets, finished by inline AI in the file itself.
Ask in one sentence for roll-ups, trackers and the cleanup you repeat every week. Your files never leave your computer.





