Operelio

How to use VLOOKUP in Excel and Google Sheets

VLOOKUP is the spreadsheet function that pulls a value out of a second table by matching on a shared column. In Excel and Google Sheets the formula is =VLOOKUP(lookup_value, table_array, col_index_num, FALSE).

By Operelio team · Updated October 15, 2026 · 14 min read

On this page13 sections
  1. 1What is VLOOKUP?
  2. 2The VLOOKUP formula, argument by argument
  3. 3How to do a VLOOKUP in Excel, step by step
  4. 4Before the file goes into your CRM
  5. 5How to do a VLOOKUP between two sheets or two workbooks
  6. 6How to use VLOOKUP in Google Sheets
  7. 7VLOOKUP with wildcards and partial matches
  8. 8VLOOKUP with two criteria
  9. 9VLOOKUP approximate match (TRUE), worked through
  10. 10Why is my VLOOKUP not working?
  11. 11VLOOKUP vs XLOOKUP
  12. 12Match two whole files without a formula
  13. 13Frequently asked questions

What is VLOOKUP?

You give VLOOKUP a value to find, such as an email address. It searches the first column of a table for that value, goes across the same row, and returns whatever is in the column you asked for, such as the company name. The V stands for vertical: it searches down a column. Excel and Google Sheets both have it, and the formula is the same in both.

The most common job is joining two exports: a list of leads from one system and a list of accounts from another, matched on email so each lead gets its company, owner or status before the file goes into the CRM.

The VLOOKUP formula, argument by argument

VLOOKUP takes four arguments, in this order:

Excel and Google Sheets
=VLOOKUP(lookup_value, table_array, col_index_num, FALSE)
ArgumentWhat it isExample
lookup_valueThe value to find. Usually a cell on the current row.A2
table_arrayThe table to search. VLOOKUP looks for the value in its first column only.Companies!$A$2:$B$500
col_index_numWhich column of that table to return, counting the table's first column as 1. It counts from the table, not from column A of the sheet.2
range_lookupFALSE finds an exact match. TRUE, or leaving it out, finds an approximate match.FALSE
Excel with =VLOOKUP(A2, CRM!$A$2:$B$301, 2) in B2, no FALSE at the end: dreyes@oldburysolar.co.uk gets Keystone Electrical LLC as its company.
Sample data with made-up names. Without FALSE, the first email came back with another contact's company, Keystone Electrical LLC. With FALSE it returns Oldbury Solar Group.

How to do a VLOOKUP in Excel, step by step

The example: a sheet called Leads has email addresses in column A and an empty Company column B. A second sheet in the same workbook, Companies, has Email in column A and Company in column B. The formula fills in each lead's company from the Companies sheet.

To follow along, download the practice workbook. It has this example's Leads and Companies sheets, with made-up names and email addresses.

  1. Check the lookup column comes first

    VLOOKUP only searches the first column of the table you give it, and only returns columns to the right of it. On the Companies sheet, Email is column A, so the table can start there. If the email column sat to the right of Company, you would move it, or use XLOOKUP or INDEX MATCH instead (both are further down).

  2. Start the formula on the first row

    On the Leads sheet, click B2 and type =VLOOKUP(A2, so A2, the first lead's email, is the value to find.

  3. Select the table on the other sheet

    Click the Companies sheet tab and select A2:B500, or however far your data goes. Excel writes Companies!A2:B500 into the formula. Press F4 (Cmd+T on a Mac) to make it Companies!$A$2:$B$500. The $ signs stop the range from moving down a row each time you copy the formula down.

  4. Finish the formula

    Type , 2, FALSE) and press Enter. The 2 returns the table's second column, Company. Excel takes you back to the Leads sheet, and B2 shows the company for the first email. The whole formula reads =VLOOKUP(A2, Companies!$A$2:$B$500, 2, FALSE).

    Excel with =VLOOKUP(A2,CRM!$A$2:$B$301, 2, FALSE) in B2 of a list of webinar registrations: the first email, dreyes@oldburysolar.co.uk, gets Oldbury Solar Group.
    In our test the table was on a tab called CRM, so the formula reads CRM!$A$2:$B$301.
  5. Copy it down the column

    Click B2 and double-click the small square at the bottom right of the cell. Excel copies the formula down as far as the data in column A goes, and each row looks up its own email.

  6. Check the rows that show #N/A

    #N/A means that email is not in the Companies sheet's first column. Sometimes that is true. Often it is a stray space or a difference you cannot see, so check a few before you trust them (the fixes are below).

    Rows 10 to 13 after the formula is copied down column B: two emails get a company, and the two not on the CRM tab show #N/A.

Before the file goes into your CRM

Two things catch people out when the sheet with the VLOOKUP is the file they import.

First, the #N/A cells. Save the sheet as a CSV and each one is written as the text #N/A, which a CRM import reads as a real value. Every contact without a match ends up with #N/A as their company. Wrap the formula in IFNA to leave those cells blank instead: =IFNA(VLOOKUP(A2, Companies!$A$2:$B$500, 2, FALSE), ""). If you change only some cells this way, Excel marks them with a small green triangle because their formula differs from the cells around them. That is a note, not an error.

Second, the formulas themselves. They depend on the Companies sheet, so delete or move it and every cell turns to #REF!. Once the results look right, select the column, copy it, and paste it back with Home, Paste, Paste Values. The companies stay and the formulas go.

How to do a VLOOKUP between two sheets or two workbooks

Between two sheets in the same workbook, the steps above are all there is: the sheet name and an exclamation mark go in front of the range, as in Companies!$A$2:$B$500. Excel adds the name for you when you click across to select. If the sheet name has a space in it, Excel wraps it in single quotes, as in 'Company list'!$A$2:$B$500.

Between two separate workbooks, open both first. Start the formula in the workbook that needs the values, then switch to the other one with View, Switch Windows, and select the range. Excel adds the file name in square brackets and makes the reference absolute on its own: =VLOOKUP(A2, [Companies.xlsx]Sheet1!$A$2:$B$500, 2, FALSE). If the file name has a hyphen or a space, Excel puts single quotes around the file and sheet, as in '[crm-contacts.xlsx]CRM'!$A$2:$B$301. If a CSV copy of the file is open too, Switch Windows lists both, so close the CSV first.

When you close the source workbook, Excel rewrites the reference to include the file's full path and keeps the last values it read. The next time you open the workbook with the formula, Excel warns that it links to external sources and asks you to choose Update or Don't Update. If you move or rename the source file, the link breaks, which is another reason to paste the results as values once they are right.

Excel's formula bar with a VLOOKUP into another open workbook: =VLOOKUP(A2,'[crm-contacts.xlsx]CRM'!$A$2:$B$301, 2, FALSE).
The file name has a hyphen, so Excel put single quotes around the file and sheet.

How to use VLOOKUP in Google Sheets

The formula is the same. Type =VLOOKUP(A2, Companies!$A$2:$B$500, 2, FALSE) into a Google Sheet with the same two tabs and it returns the same result. Google names the arguments differently (search_key, range, index and is_sorted), but they do the same jobs in the same order.

Google Sheets also assumes a sorted range unless you say otherwise, so it needs the FALSE at the end too. When you press Enter, Sheets usually offers Suggested auto-fill for the rest of the column: click the checkmark to accept it. Otherwise, drag the small square at the bottom right of the cell down the column.

The real difference is looking up from another file. VLOOKUP cannot point at a different spreadsheet directly, so you wrap the range in IMPORTRANGE with the other file's URL, as in the formula below. The first time, the cell shows #REF! until you connect the two files: click the cell and then Allow access. The range names the tab in the other file, so check its name: a spreadsheet made by importing a CSV names its tab after the file.

Google Sheets, from another file
=VLOOKUP(A2, IMPORTRANGE("https://docs.google.com/spreadsheets/d/...", "Companies!A2:B500"), 2, FALSE)
Google Sheets with a VLOOKUP over IMPORTRANGE in B2 showing #REF!, and the note beside it: You need to connect these spreadsheets, with an Allow access button.
The first time, the cell shows #REF! until you click Allow access.

VLOOKUP with wildcards and partial matches

When the value you have is only part of what the table holds, put wildcards in the lookup value. An asterisk (*) stands for any number of characters and a question mark (?) for any one character. Microsoft's VLOOKUP page allows them when the formula ends with FALSE and the lookup value is text.

The CRM case: your event list says Morrowgate Foods and the CRM's Accounts tab says Morrowgate Foods Inc. Join an asterisk to the cell and VLOOKUP finds any account name that starts with it, then returns its owner from column B: =VLOOKUP(A2&"*", Accounts!$A$2:$B$121, 2, FALSE).

Keep the pattern as long as the value you have. If more than one account fits, the formula still returns one owner, with no sign that another account matched. On the same tab, "Morrowgate*" fits Morrowgate Foods Inc, Morrowgate Electrical Ltd, Morrowgate Clinics and Morrowgate Motors Inc.

XLOOKUP reads wildcards only when its match_mode argument is 2: =XLOOKUP(A2&"*", Accounts!$A$2:$A$121, Accounts!$B$2:$B$121, "", 2). Wildcards cover a missing word at the start or end. A typo or a different word order, like Morowgate Foods Inc, still finds nothing; for that, match the two files with similarity matching instead.

Lookup valueFindsExample
A2&"*"Text that starts with A2Morrowgate Foods finds Morrowgate Foods Inc
"*"&A2Text that ends with A2Foods Inc finds an account ending in Foods Inc, such as Morrowgate Foods Inc
"*"&A2&"*"Text that contains A2 anywhereFoods finds Morrowgate Foods Inc, or any other account with Foods in its name
"Sm?th"One character that can be anythingSmith and Smyth
"fy06~?"A real question mark or asterisk: put a tilde (~) in frontThe text fy06?

VLOOKUP with two criteria

VLOOKUP matches on one value. To match on two, such as first name and last name when a file has no email, join the two into one value on both sides of the lookup: in the table with a helper column, and in the formula with the same join. The & sign joins two values into one piece of text.

  1. Add a key column to the front of the table

    On the Contacts sheet, insert a column before First Name and call it Key. In A2 type =B2&"|"&C2 and copy it down. Sofia in B2 and Rhodes in C2 become Sofia|Rhodes. The key has to be the table's first column, because VLOOKUP only searches there.

  2. Look up the same join

    On the sheet that needs the emails, with first names in A and last names in B, type =VLOOKUP(A2&"|"&B2, Contacts!$A$2:$D$151, 4, FALSE). It joins the two names the same way, finds that key, and returns the fourth column of the table, Email.

  3. Keep the separator

    The | stops two different pairs from joining into the same text. Without it, account 12 in region 34 and account 123 in region 4 both join to 1234. If two contacts share both names, add a third column, such as company, to both joins.

The same lookup with XLOOKUP
=XLOOKUP(A2&"|"&B2, Contacts!$A$2:$A$151, Contacts!$D$2:$D$151, "")

VLOOKUP approximate match (TRUE), worked through

An approximate match is for bands: lead score grades, discount tiers, tax brackets. The lookup table lists where each band starts, sorted from smallest to largest, and VLOOKUP returns the band for any value in between. Here a Grades sheet turns a lead score from the CRM into a grade, with =VLOOKUP(B2, Grades!$A$2:$B$5, 2, TRUE) next to each score.

A score of 85 is not in the Score from column, so VLOOKUP takes the largest value that is less than or equal to 85. That is 70, and it returns Hot. A score of 40 matches exactly and returns Warm, 39 returns Cold, and 100 returns Priority.

Two things break it. A value smaller than the first band, such as -5, returns #N/A, which is why the first band starts at 0. And the Score from column has to be sorted from smallest to largest: unsorted, TRUE can return a band from the wrong row with no error. TRUE is also what you get when you leave the fourth argument out, which is why a lookup on emails needs FALSE.

XLOOKUP does the same with match_mode -1, which takes an exact match or else the next smaller item: =XLOOKUP(B2, Grades!$A$2:$A$5, Grades!$B$2:$B$5, "", -1). Microsoft's XLOOKUP page asks for sorted data only in its binary search modes, which this formula doesn't use.

Score from (column A)Grade (column B)Scores that get it
0Cold0 to 39
40Warm40 to 69
70Hot70 to 89
90Priority90 and up

Why is my VLOOKUP not working?

These are the usual causes, with the fix for each. The error rows follow Microsoft's VLOOKUP page and its articles on `#N/A, #VALUE! and #NAME?`.

What you seeWhyFix
#N/A on a value you can see in the tableA stray space before or after the value, in either sheet. Text pasted from web pages can also carry non-breaking spaces, which look the same but are a different character.Look up the trimmed value with =VLOOKUP(TRIM(A2), ...). If the spaces are in the table, clean that column first with TRIM, plus SUBSTITUTE(A2,UNICHAR(160)," ") for non-breaking spaces. Use UNICHAR, not CHAR: in Excel for Mac, CHAR(160) is a different character.
#N/A on IDs, ZIP codes or phone numbersNumbers stored as text in one sheet and as numbers in the other. 1042 and "1042" never match.Convert the text column: Excel marks those cells with a green triangle, and the warning menu has Convert to Number. Or match the table's format in the formula, as in =VLOOKUP(A2&"", ...) when the table holds text.
#N/A on values that are not in the tableThe value is not there.Wrap the formula in IFNA to show a blank or a word of your choice: =IFNA(VLOOKUP(...), "Not found").
A result from the wrong row, with no errorThe fourth argument is TRUE or missing, so VLOOKUP did an approximate match on an unsorted list.End the formula with FALSE.
The wrong column comes backcol_index_num counts from the first column of the table, not from column A. Inserting a column into the table also shifts what the number points at.Count again from the table's first column, or use XLOOKUP, which does not use a column number.
#REF!col_index_num is larger than the number of columns in the table.Widen the table to include the column you want, or lower the number.
#N/A because the match is to the leftVLOOKUP only searches the table's first column and only returns columns to its right.Move the lookup column to the front, or use XLOOKUP or INDEX MATCH.
Rows further down stop matchingThe table range moved when the formula was copied down, because it had no $ signs.Make the range absolute: $A$2:$B$500.
#VALUE!The lookup value is longer than 255 characters, or col_index_num is less than 1 or is text. A function nested in col_index_num can return 0 without you seeing it.Shorten the lookup value, or use INDEX MATCH instead. Make col_index_num 1 or more.
#NAME?The function's name is misspelled, as in =VLOKUP(...), or text in the formula has no quotes: =VLOOKUP(Kestrelmere, ...) instead of =VLOOKUP("Kestrelmere", ...).Fix the spelling, or put the text in double quotes. Don't hide this one with IFERROR: the formula itself is wrong.
#SPILL!The lookup value is a whole column, as in =VLOOKUP(A:A, A:C, 2, FALSE).Point at one cell, =VLOOKUP(A2, A:C, 2, FALSE), or put @ in front of the column: =VLOOKUP(@A:A, A:C, 2, FALSE).

VLOOKUP vs XLOOKUP

XLOOKUP is the newer function. It takes the column to search and the column to return as two separate ranges, so there is no column number to count and nothing breaks when a column is inserted. It finds an exact match unless you ask for something else, it can return a column to the left of the one it searches, and it has its own argument for what to show when nothing matches. The worked example becomes =XLOOKUP(A2, Companies!$A$2:$A$500, Companies!$B$2:$B$500, "").

XLOOKUP is in Microsoft 365, Excel 2021 and later, Excel for the web and Google Sheets. It is not in Excel 2016 or Excel 2019, and a file that uses it shows errors when opened there. If anyone who opens the file is on an older version, stay with VLOOKUP.

INDEX MATCH is the older way to get the same flexibility, and it works in every version: =INDEX(Companies!$B$2:$B$500, MATCH(A2, Companies!$A$2:$A$500, 0)). MATCH finds the row number, INDEX returns the value from that row of the column you name, and the 0 asks for an exact match.

Match two whole files without a formula

A VLOOKUP works one cell at a time, and the file has to be clean for it to work. Operelio's Match & Pull Columns does the same job on two whole files. Upload the file you want filled in and the file the extra columns come from, pick the shared column, and pick which columns to bring across. Every row is matched in one run and you download one combined file.

It also covers what a VLOOKUP cannot. It matches on more than one column at once, such as first name and last name together. Similarity matching catches typos and small differences, like Morowgate Foods Inc in one file and MORROWGATE FOODS INC in the other. You choose whether to keep every row, only the rows that matched, or every row from both files. The two files can be CSV or Excel, in any mix, and the originals are never changed.

All of it is on every plan, including Free, which reads up to 2,000 rows in each file.

A finished Match & Pull Columns run in Operelio: contacts_export.csv filled in from enrichment_data.csv on Work Email, 4,920 of 5,875 rows matched and 955 with no match, with the pulled Job Title, Company Size, Industry, Phone and LinkedIn columns shaded in the preview.
One run on two whole files: 4,920 of the list's 5,875 rows matched on Work Email, and the columns pulled in are shaded.

Frequently asked questions

What does FALSE mean at the end of a VLOOKUP?

Exact match. FALSE tells VLOOKUP to return a value only when it finds the lookup value itself. TRUE, or leaving the argument out, asks for an approximate match, which assumes the first column is sorted and returns the nearest smaller value. On an unsorted list that is often a value from the wrong row.

Can VLOOKUP look to the left?

No. It only searches the first column of the table and only returns columns to the right of it. To return a column on the left, move the lookup column to the front, or use XLOOKUP or INDEX MATCH, which take the search column and the return column separately.

Can VLOOKUP return more than one column?

One formula returns one column, so the usual way is to copy it across and change the column number in each copy. In Microsoft 365 and Excel 2021 or later, a list of column numbers returns several at once: =VLOOKUP(A2, Companies!$A$2:$D$500, {2,3,4}, FALSE) fills three cells to the right. In Google Sheets, wrap that in ARRAYFORMULA. Without it, Sheets returns only the first of the columns, with no error.

What is the difference between VLOOKUP and HLOOKUP?

HLOOKUP is the same lookup on its side. It searches the top row of a table and returns a value from a row you name further down, where VLOOKUP searches the first column and returns from a column to its right. Use HLOOKUP when the labels run across the top of the data. XLOOKUP can replace both.

Is INDEX MATCH better than VLOOKUP?

It is more flexible. MATCH finds the row and INDEX returns the value from any column you name, so it can return a column to the left and has no column number to count. In Microsoft 365 and Excel 2021 or later, XLOOKUP does the same in one function, as in VLOOKUP vs XLOOKUP above.

Can VLOOKUP find the return column by its header?

Yes, with MATCH in place of the column number. MATCH returns the position of a value in a range, so =VLOOKUP(A2, Companies!$A$1:$D$500, MATCH("Owner", Companies!$A$1:$D$1, 0), FALSE) returns the Owner column wherever it sits in the table.

Can I use VLOOKUP with an Excel Table?

Yes. Select a cell in the data, choose Home > Format as Table, then name the table in the Table Name box on the Table Design tab. Use the name as the table: =VLOOKUP(A2, Companies, 2, FALSE). The name covers the table's data without its header row and adjusts as you add or remove rows, so there is no $A$2:$B$500 to widen later.

Next in Spreadsheet cleanup How to remove duplicates in Google SheetsFind, highlight and remove duplicates in Google Sheets: a COUNTIF rule to see them, Data cleanup or UNIQUE to remove them, and keeping the last copy.13 min read

Try it on your own file

Upload a file and run your first tool on it. Free, no credit card required.