In Excel: use =VLOOKUP(lookup_value, table_array, col_index_num, FALSE) — it finds a value in the leftmost column of a table and returns a value from a column to its right, with FALSE forcing an exact match.
Syntax
Arguments
| Argument | Description | |
|---|---|---|
lookup_value | required | The value to look for in the first column of the table. |
table_array | required | The range that holds the data, with the lookup column on the far left. |
col_index_num | required | The column number to return from, counted from the left of table_array (1 = first column). |
range_lookup | optional | FALSE for an exact match, TRUE or omitted for an approximate match on sorted data. |
Related functions
In the result cell type =VLOOKUP( and click the cell holding the value to find.
Select the whole table as table_array, making sure the lookup column is the leftmost one.
Count columns from the left of that range to the answer column and type that number as col_index_num.
Type FALSE as the fourth argument to force an exact match.
Press Enter and fill the formula down the column.
What this does
VLOOKUP searches down the first column of a table for a value, then returns whatever sits in the same row in a column you choose by number. It is the classic Excel lookup: you give it the value to find, the table, the column count, and a FALSE flag for an exact match. The catch is that it only looks to the right of the lookup column and you must count the return column yourself. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “comparing two columns in excel using vlookup”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected columns change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a data step that keeps your analysis trustworthy useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
Employee names are in A2:A100 and salaries in C2:C100, so the table spans A2:C100. To pull the salary for the name in E2: =VLOOKUP(E2, A2:C100, 3, FALSE). Column 3 is the salary column counted from A, and FALSE returns #N/A rather than a wrong row if the name is missing. For "Maria" in E2 this returns 54000. VLOOKUP is the most widely used lookup in Excel and works in every version, so it stays the go-to when a file must open in older Excel that lacks XLOOKUP. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. Keep this page bookmarked for the next time the same question comes up. Better still, rebuild the example once in your own sheet — doing it yourself, with the tool above to check against, is what turns a copied formula into a technique you own. The short version of “comparing two columns in excel using vlookup”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.
Common mistakes
- Leaving off FALSE, so
VLOOKUPdoes an approximate match and returns the wrong row when the data is not sorted. - Counting col_index_num from the worksheet column A instead of from the left edge of table_array.
- Trying to return a value to the left of the lookup column —
VLOOKUPcan only look right, so useINDEX/MATCHorXLOOKUPinstead.
Frequently asked questions
Why does VLOOKUP return #N/A?
The lookup value was not found in the first column. Common causes are stray spaces (wrap the value in TRIM), numbers stored as text, or a lookup value that simply is not present. Wrapping the formula in IFERROR can replace #N/A with friendlier text.
Can VLOOKUP look to the left?
No. VLOOKUP only returns columns to the right of the lookup column. To pull a value from a column further left, use INDEX/MATCH or XLOOKUP, which search in any direction.
What does the FALSE at the end do?
FALSE forces an exact match. TRUE or an omitted fourth argument does an approximate match that requires the first column to be sorted ascending and can silently return a wrong row, so always add FALSE for normal lookups.
Other ways people ask this
This is also commonly searched as “how to use vlookup in excel for comparing two columns” and “comparing two columns in excel with vlookup”. They describe the identical operation, so you are in the right place no matter how you phrased it.
Why do people search for this in so many different ways?
Because the same task has many names. “how to use vlookup in excel for comparing two columns”, “comparing two columns in excel with vlookup” all point at the one operation explained on this page, which is why they all lead here.