VLOOKUP function - Microsoft Support (2024)

Skip to main content

Microsoft

Support

Support

Sign in

Sign in with Microsoft

Sign in or create an account.

Hello,

Select a different account.

You have multiple accounts

Choose the account you want to sign in with.

Excel

Formulas and functions

Reference

Reference

VLOOKUP function

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2013 More...Less

Tip:Try using the new XLOOKUP function, an improved version of VLOOKUP that works in any direction and returns exact matches by default, making it easier and more convenient to use than its predecessor.

Use VLOOKUP when you need to find things in a table or a range by row. For example, look up a price of an automotive part by the part number, or find an employee name based on their employee ID.

In its simplest form, the VLOOKUP function says:

=VLOOKUP(What you want to look up, where you want to look for it, the column number in the range containing the value to return, return an Approximate or Exact match – indicated as 1/TRUE, or 0/FALSE).

VLOOKUP function - Microsoft Support (2)

Tip:The secret to VLOOKUP is to organize your data so that the value you look up (Fruit) is to the left of the return value (Amount) you want to find.

Use the VLOOKUP function to look up a value in a table.

Syntax

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

For example:

  • =VLOOKUP(A2,A10:C20,2,TRUE)

  • =VLOOKUP("Fontana",B2:E7,2,FALSE)

  • =VLOOKUP(A2,’Client Details’!A:F,3,FALSE)

Argument name

Description

lookup_value (required)

The value you want to look up. The value you want to look up must be in the first column of the range of cells you specify in thetable_array argument.

For example, if table-array spans cells B2:D7, then your lookup_value must be in column B.

Lookup_value can be a value or a reference to a cell.

table_array (required)

The range of cells in which the VLOOKUP will search for the lookup_value and the return value. You can use a named range or a table, and you can use names in the argument instead of cell references.

The first column in the cell range must contain the lookup_value. The cell range also needs to include the return value you want to find.

Learn how to select ranges in a worksheet.

col_index_num (required)

The column number (starting with 1 for the left-most column of table_array) that contains the return value.

range_lookup(optional)

A logical value that specifies whether you want VLOOKUP to find an approximate or an exact match:

  • Approximate match - 1/TRUE assumes the first column in the table is sorted either numerically or alphabetically, and will then search for the closest value. This is the default method if you don't specify one. For example, =VLOOKUP(90,A1:B100,2,TRUE).

  • Exact match - 0/FALSE searches for the exact value in the first column. For example,=VLOOKUP("Smith",A1:B100,2,FALSE).

How to get started

There are four pieces of information that you will need in order to build the VLOOKUP syntax:

  1. The value you want to look up, also called the lookup value.

  2. The range where the lookup value is located. Remember that the lookup value should always be in the first column in the range for VLOOKUP to work correctly. For example, if your lookup value is in cell C2 then your range should start with C.

  3. The column number in the range that contains the return value. For example, if you specify B2:D11 as the range, you should count B as the first column, C as the second, and so on.

  4. Optionally, you can specify TRUE if you want an approximate match or FALSE if you want an exact match of the return value. If you don't specify anything, the default value will always be TRUE or approximate match.

Now put all of the above together as follows:

=VLOOKUP(lookup value, range containing the lookup value, the column number in the range containing the return value, Approximate match (TRUE) or Exact match (FALSE)).

Examples

Here are a few examples of VLOOKUP:

Example 1

VLOOKUP function - Microsoft Support (3)

Example 2

VLOOKUP function - Microsoft Support (4)

Example 3

VLOOKUP function - Microsoft Support (5)

Example 4

VLOOKUP function - Microsoft Support (6)

Example 5

VLOOKUP function - Microsoft Support (7)

You can use VLOOKUP to combine multiple tables into one, as long as one of the tables has fields in common with all the others. This can be especially useful if you need to share a workbook with people who have older versions of Excel that don't support data features with multiple tables as data sources - by combining the sources into one table and changing the data feature's data source to the new table, the data feature can be used in older Excel versions (provided the data feature itself is supported by the older version).

VLOOKUP function - Microsoft Support (8)

Here, columns A-F and H have values or formulas that only use values on the worksheet, and the rest of the columns use VLOOKUP and the values of column A (Client Code) and column B (Attorney) to get data from other tables.

  1. Copy the table that has the common fields onto a new worksheet, and give it a name.

  2. Click Data > Data Tools > Relationships to open the Manage Relationships dialog box.

    VLOOKUP function - Microsoft Support (9)
  3. For each listed relationship, note the following:

    • The field that links the tables (listed in parentheses in the dialog box). This is the lookup_value for your VLOOKUP formula.

    • The Related Lookup Table name. This is the table_array in your VLOOKUP formula.

    • The field (column) in the Related Lookup Table that has the data you want in your new column. This information is not shown in the Manage Relationships dialog - you'll have to look at the Related Lookup Table to see which field you want to retrieve. You want to note the column number (A=1) - this is the col_index_num in your formula.

  4. To add a field to the new table, enter your VLOOKUP formula in the first empty column using the information you gathered in step 3.

    In our example, column G uses Attorney (the lookup_value) to get the Bill Rate data from the fourth column (col_index_num = 4) from the Attorneys worksheet table, tblAttorneys (the table_array), with the formula =VLOOKUP([@Attorney],tbl_Attorneys,4,FALSE).

    The formula could also use a cell reference and a range reference. In our example, it would be =VLOOKUP(A2,'Attorneys'!A:D,4,FALSE).

  5. Continue adding fields until you have all the fields that you need. If you are trying to prepare a workbook containing data features that use multiple tables, change the data source of the data feature to the new table.

Problem

What went wrong

Wrong value returned

If range_lookup is TRUE or left out, the first column needs to be sorted alphabetically or numerically. If the first column isn't sorted, the return value might be something you don't expect. Either sort the first column, or use FALSE for an exact match.

#N/A in cell

  • If range_lookup is TRUE, then if the value in the lookup_value is smaller than the smallest value in the first column of the table_array, you'll get the #N/A error value.

  • If range_lookup is FALSE, the #N/A error value indicates that the exact number isn't found.

For more information on resolving #N/A errors in VLOOKUP, see How to correct a #N/A error in the VLOOKUP function.

#REF! in cell

If col_index_num is greater than the number of columns in table-array, you'll get the #REF! error value.

For more information on resolving #REF! errors in VLOOKUP, see How to correct a #REF! error.

#VALUE! in cell

If the table_array is less than 1, you'll get the #VALUE! error value.

For more information on resolving #VALUE! errors in VLOOKUP, see How to correct a #VALUE! error in the VLOOKUP function.

#NAME? in cell

The #NAME? error value usually means that the formula is missing quotes. To look up a person's name, make sure you use quotes around the name in the formula. For example, enter the name as "Fontana" in =VLOOKUP("Fontana",B2:E7,2,FALSE).

For more information, see How to correct a #NAME! error.

#SPILL! in cell

This particular #SPILL! error usually means that your formula is relying on implicit intersection for the lookup value, and using an entire column as a reference. For example, =VLOOKUP(A:A,A:C,2,FALSE). You can resolve the issue by anchoring the lookup reference with the @ operator like this: =VLOOKUP(@A:A,A:C,2,FALSE). Alternatively, you can use the traditional VLOOKUP methodand refer to a single cell instead of an entire column: =VLOOKUP(A2,A:C,2,FALSE).

Do this

Why

Use absolute references for range_lookup

Using absolute references allows you to fill-down a formula so that it always looks at the same exact lookup range.

Learn how to use absolute cell references.

Don't store number or date values as text.

When searching number or date values, be sure the data in the first column of table_array isn't stored as text values. Otherwise, VLOOKUP might return an incorrect or unexpected value.

Sort the first column

Sort the first column of the table_array before using VLOOKUP when range_lookup is TRUE.

Use wildcard characters

If range_lookup is FALSE and lookup_value is text, you can use the wildcard characters—the question mark (?) and asterisk (*)—in lookup_value. A question mark matches any single character. An asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) in front of the character.

For example, =VLOOKUP("Fontan?",B2:E7,2,FALSE) will search for all instances of Fontana with a last letter that could vary.

Make sure your data doesn't contain erroneous characters.

When searching text values in the first column, make sure the data in the first column doesn't have leading spaces, trailing spaces, inconsistent use of straight ( ' or " ) and curly ( ‘ or “) quotation marks, or nonprinting characters. In these cases, VLOOKUP might return an unexpected value.

To get accurate results, try using the CLEAN function or the TRIM function to remove trailing spaces after table values in a cell.

Need more help?

You can always ask an expert in the Excel Tech Communityor get support inCommunities.

See Also

XLOOKUP function

Video: When and how to use VLOOKUP

Quick Reference Card: VLOOKUP refresher

How to correct a #N/A error in the VLOOKUP function

Look up values with VLOOKUP, INDEX, or MATCH

HLOOKUP function

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

VLOOKUP function - Microsoft Support (10)

Microsoft 365 subscription benefits

VLOOKUP function - Microsoft Support (11)

Microsoft 365 training

VLOOKUP function - Microsoft Support (12)

Microsoft security

VLOOKUP function - Microsoft Support (13)

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

VLOOKUP function - Microsoft Support (14)

Ask the Microsoft Community

VLOOKUP function - Microsoft Support (15)

Microsoft Tech Community

Thank you for your feedback!

×

VLOOKUP function - Microsoft Support (2024)

FAQs

Why Excel Cannot use VLOOKUP? ›

Problem: The lookup value is not in the first column in the table_array argument. One constraint of VLOOKUP is that it can only look for values on the left-most column in the table array. If your lookup value is not in the first column of the array, you will see the #N/A error.

Which function is supported by MS Excel? ›

Excel formulas enable you to perform calculations such as addition, subtraction, multiplication, and division. In addition to these, you can find out averages and calculate percentages in excel for a range of cells, manipulate date and time values, and do a lot more.

How do I enable VLOOKUP in Excel? ›

Enter the VLOOKUP formula: Type "=" (equals sign) in the selected cell to start a formula, then type "VLOOKUP(". This will prompt Excel to expect the arguments for the VLOOKUP function. Enter the lookup value: Switch to Spreadsheet A and click on the cell that contains the lookup value you identified in step 2.

What is Microsoft VLOOKUP? ›

Use the VLOOKUP function to look up a value in a table. Syntax. VLOOKUP (lookup_value, table_array, col_index_num, [range_lookup]) For example: =VLOOKUP(A2,A10:C20,2,TRUE)

Is VLOOKUP obsolete in Excel? ›

Have you ever used VLOOKUP to bring a column from one table into another table? Now that Excel has a built-in Data Model, VLOOKUP is obsolete. You can create a relationship between two tables of data, based on matching data in each table.

Why is VLOOKUP not good? ›

A limitation of the VLOOKUP function is that it cannot look to its left. It will look down the leftmost column of a table and return information from the right.

Which function is not used in MS Excel application? ›

The correct answer is AVG.

What is the formula for VLOOKUP? ›

Click the cell where you want Excel to return the data you're looking for. Enter =VLOOKUP(lookup value,table array,column index number,range lookup) . Press Enter or Return.

Which of the following is not a function in Microsoft Excel? ›

ALT is not a function in Microsoft Excel spreadsheets.

Why is VLOOKUP not working in Office 365? ›

One of the most common reasons you can expect VLOOKUP to malfunction is the wrong formatting of the values. These product codes are stored as text. This may be because of the formatting applied to them. Or if they have an apostrophe before them like here.

What can I use in Excel instead of VLOOKUP? ›

The superior alternative to VLOOKUP is INDEX MATCH. While VLOOKUP works fine in most cases, it tends to reveal flaws when you start using it in large and complex sheets. The INDEX MATCH formula is actually two different functions; INDEX and MATCH. array is range of cells or an array constant.

What is the difference between VLOOKUP and Xlookup? ›

VLOOKUP forces the user to indicate the entire table_array, searching for the lookup value exclusively in the leftmost column. The column to return a value from is determined by the column number in the subsequent argument. XLOOKUP, in contrast, allows the lookup and return columns to be specified separately.

What are the three rules for VLOOKUP? ›

The VLOOKUP function consists of three required arguments, in the following order: lookup value, table array, and column index number. The lookup value is the value for which you want to find matching data and must appear in the first column of the lookup table; it can be a value, a text string, or a cell reference.

What is the alternative for VLOOKUP? ›

The superior alternative to VLOOKUP is INDEX MATCH. While VLOOKUP works fine in most cases, it tends to reveal flaws when you start using it in large and complex sheets. The INDEX MATCH formula is actually two different functions; INDEX and MATCH.

Why is VLOOKUP not working sheets? ›

With VLOOKUP, your lookup value must be in the first (farthest left) column of the range you're working with. If the value is in a column to the right of the information you're looking for, the function won't work.

Why VLOOKUP does not return the correct value in Excel? ›

VLOOKUP Returns a value but it is incorrect

There are a number of possible reasons for this: You didn't specify whether Excel must do an Exact or Approximate match (true or false as the last criteria) You specified that Excel does an approximate match but you should have required an exact match.

Top Articles
Latest Posts
Article information

Author: Clemencia Bogisich Ret

Last Updated:

Views: 6382

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Clemencia Bogisich Ret

Birthday: 2001-07-17

Address: Suite 794 53887 Geri Spring, West Cristentown, KY 54855

Phone: +5934435460663

Job: Central Hospitality Director

Hobby: Yoga, Electronics, Rafting, Lockpicking, Inline skating, Puzzles, scrapbook

Introduction: My name is Clemencia Bogisich Ret, I am a super, outstanding, graceful, friendly, vast, comfortable, agreeable person who loves writing and wants to share my knowledge and understanding with you.