Look up values with VLOOKUP, INDEX, or MATCH (2023)

Tip:Try using the new XLOOKUP and XMATCH functions, improved versions of the functions described in this article. These new functions work in any direction and return exact matches by default, making them easier and more convenient to use than their predecessors.

Suppose that you have a list of office location numbers, and you need to know which employees are in each office. The spreadsheet is huge, so you might think it is challenging task.It's actually quite easy to do with alookup function.

The VLOOKUP and HLOOKUP functions, together with INDEX and MATCH, are some of the most useful functions in Excel.

Note:The Lookup Wizard feature is no longer available inExcel.

Here's an example of how to use VLOOKUP.

=VLOOKUP(B2,C2:E7,3,TRUE)

(Video) Lookup values across multiple worksheets: VLOOKUP / INDEX MATCH in Excel

In this example, B2 is the first argument—an elementof data that the function needs to work. For VLOOKUP, this first argument is the value that you want to find. This argumentcan be a cell reference, or a fixed value such as "smith" or 21,000. The second argument is the range of cells, C2-:E7, in which to search forthe value you want to find. The third argument is the column in that range of cells that contains the value that you seek.

The fourth argument is optional. Enter eitherTRUE or FALSE. If you enter TRUE, or leave the argument blank, the function returns an approximate match of the value you specify in the first argument. If you enter FALSE, the function will match the value provide by the first argument. In other words, leaving the fourth argument blank—or entering TRUE—gives you more flexibility.

This example shows you how the function works. When you enter a value in cell B2 (the first argument), VLOOKUP searches the cells in the range C2:E7 (2nd argument) and returns the closest approximate match from the third column in the range, column E (3rd argument).

Look up values with VLOOKUP, INDEX, or MATCH (1)

The fourth argument is empty, so the function returns an approximate match. If it didn't, you'd have to enter one of the values in columns C or D to get a result at all.

(Video) INDEX MATCH Explained (An Alternative to VLOOKUP)

When you're comfortable with VLOOKUP, the HLOOKUP function is equally easy to use. You enter the same arguments, but it searchesin rows instead of columns.

Using INDEX and MATCH instead of VLOOKUP

There are certain limitations with using VLOOKUP—the VLOOKUP function can only look up a value from left to right. This means that the column containing the value you look up should always be located to the left of the column containing the return value. Now if your spreadsheet isn't built this way, then do not use VLOOKUP. Use the combination of INDEX and MATCH functions instead.

This example shows a small list where the value we want to search on, Chicago, isn't in the leftmost column. So, we can't use VLOOKUP. Instead, we'll use the MATCH function to find Chicago in the range B1:B11. It's found in row 4. Then, INDEX uses that value as the lookup argument, and finds the population for Chicago in the 4th column (column D). The formula used is shown in cell A14.

Look up values with VLOOKUP, INDEX, or MATCH (2)

For more examples of using INDEX and MATCH instead of VLOOKUP, see the article https://www.mrexcel.com/excel-tips/excel-vlookup-index-match/ by Bill Jelen, Microsoft MVP.

Give it a try

If you want to experiment with lookup functions before you try them out with your own data, here's some sample data.

(Video) Vlookup vs Index and Match in Excel by Chris Menard

VLOOKUP Example at work

Copy the following data into a blank spreadsheet.

Tip:Before you paste the data into Excel, set the column widths for columns A through C to 250 pixels, and click Wrap Text (Home tab, Alignment group).

Density

Viscosity

Temperature

0.457

3.55

500

0.525

3.25

400

0.606

2.93

300

0.675

2.75

250

0.746

2.57

200

0.835

2.38

150

0.946

2.17

100

1.09

1.95

50

1.29

1.71

Formula

Description

Result

=VLOOKUP(1,A2:C10,2)

Using an approximate match, searches for the value 1 in column A, finds the largest value less than or equal to 1 in column A which is 0.946, and then returns the value from column B in the same row.

2.17

=VLOOKUP(1,A2:C10,3,TRUE)

Using an approximate match, searches for the value 1 in column A, finds the largest value less than or equal to 1 in column A, which is 0.946, and then returns the value from column C in the same row.

100

=VLOOKUP(0.7,A2:C10,3,FALSE)

Using an exact match, searches for the value 0.7 in column A. Because there is no exact match in column A, an error is returned.

#N/A

=VLOOKUP(0.1,A2:C10,2,TRUE)

Using an approximate match, searches for the value 0.1 in column A. Because 0.1 is less than the smallest value in column A, an error is returned.

#N/A

=VLOOKUP(2,A2:C10,2,TRUE)

Using an approximate match, searches for the value 2 in column A, finds the largest value less than or equal to 2 in column A, which is 1.29, and then returns the value from column B in the same row.

1.71

HLOOKUP Example

Copy all the cells in this table and paste it into cell A1 on a blank worksheet in Excel.

Tip:Before you paste the data into Excel, set the column widths for columns A through C to 250 pixels, and click Wrap Text (Home tab, Alignment group).

Axles

Bearings

Bolts

4

4

9

5

7

10

6

8

11

Formula

Description

Result

=HLOOKUP("Axles", A1:C4, 2, TRUE)

Looks up "Axles" in row 1, and returns the value from row 2 that's in the same column (column A).

4

=HLOOKUP("Bearings", A1:C4, 3, FALSE)

Looks up "Bearings" in row 1, and returns the value from row 3 that's in the same column (column B).

7

=HLOOKUP("B", A1:C4, 3, TRUE)

Looks up "B" in row 1, and returns the value from row 3 that's in the same column. Because an exact match for "B" is not found, the largest value in row 1 that is less than "B" is used: "Axles," in column A.

5

=HLOOKUP("Bolts", A1:C4, 4)

Looks up "Bolts" in row 1, and returns the value from row 4 that's in the same column (column C).

11

=HLOOKUP(3, {1,2,3;"a","b","c";"d","e","f"}, 2, TRUE)

Looks up the number 3 in the three-row array constant, and returns the value from row 2 in the same (in this case, third) column. There are three rows of values in the array constant, each row separated by a semicolon (;). Because "c" is found in row 2 and in the same column as 3, "c" is returned.

c

INDEX and MATCH Examples

This last example employsthe INDEX and MATCH functions together to return the earliest invoice number and its corresponding date for each of five cities. Because the date is returned as a number, we use the TEXT function to format it as a date. The INDEX function actually uses the result of the MATCH function as its argument. The combination of the INDEX and MATCH functions are used twice in each formula – first, to return the invoice number, and then to return the date.

(Video) Return Multiple Match Results in Excel (2 methods)

Copy all the cells in this table and paste it into cell A1 on a blank worksheet in Excel.

Tip:Before you paste the data into Excel, set the column widths for columns A through D to 250 pixels, and click Wrap Text (Home tab, Alignment group).

Invoice

City

Invoice Date

Earliest invoice by city, with date

3115

Atlanta

4/7/12

="Atlanta = "&INDEX($A$2:$C$33,MATCH("Atlanta",$B$2:$B$33,0),1)& ", Invoice date: " & TEXT(INDEX($A$2:$C$33,MATCH("Atlanta",$B$2:$B$33,0),3),"m/d/yy")

3137

Atlanta

4/9/12

="Austin = "&INDEX($A$2:$C$33,MATCH("Austin",$B$2:$B$33,0),1)& ", Invoice date: " & TEXT(INDEX($A$2:$C$33,MATCH("Austin",$B$2:$B$33,0),3),"m/d/yy")

3154

Atlanta

4/11/12

="Dallas = "&INDEX($A$2:$C$33,MATCH("Dallas",$B$2:$B$33,0),1)& ", Invoice date: " & TEXT(INDEX($A$2:$C$33,MATCH("Dallas",$B$2:$B$33,0),3),"m/d/yy")

3191

Atlanta

4/21/12

="New Orleans = "&INDEX($A$2:$C$33,MATCH("New Orleans",$B$2:$B$33,0),1)& ", Invoice date: " & TEXT(INDEX($A$2:$C$33,MATCH("New Orleans",$B$2:$B$33,0),3),"m/d/yy")

3293

Atlanta

4/25/12

="Tampa = "&INDEX($A$2:$C$33,MATCH("Tampa",$B$2:$B$33,0),1)& ", Invoice date: " & TEXT(INDEX($A$2:$C$33,MATCH("Tampa",$B$2:$B$33,0),3),"m/d/yy")

3331

Atlanta

4/27/12

3350

Atlanta

4/28/12

3390

Atlanta

5/1/12

3441

Atlanta

5/2/12

3517

Atlanta

5/8/12

3124

Austin

4/9/12

3155

Austin

4/11/12

3177

Austin

4/19/12

3357

Austin

4/28/12

3492

Austin

5/6/12

3316

Dallas

4/25/12

3346

Dallas

4/28/12

3372

Dallas

5/1/12

3414

Dallas

5/1/12

3451

Dallas

5/2/12

3467

Dallas

5/2/12

3474

Dallas

5/4/12

3490

Dallas

5/5/12

3503

Dallas

5/8/12

3151

New Orleans

4/9/12

3438

New Orleans

5/2/12

3471

New Orleans

5/4/12

3160

Tampa

4/18/12

3328

Tampa

4/26/12

3368

Tampa

4/29/12

3420

Tampa

5/1/12

3501

Tampa

5/6/12

Quick Reference Card: VLOOKUP refresher

Lookup and reference functions (reference)

Use the table_array argument in a VLOOKUP function

(Video) VLOOKUP | Sum ALL Matching Values Or Sum ENTIRE MATCHING ROW or COLUMN

FAQs

Should I use INDEX match or VLOOKUP? ›

While VLookup is great for searching for fields where you know the row, Index Match is much more flexible as you can search by row, or by column, or by both. In these situations its best to use Index Match instead of VLookup.

Is INDEX match more accurate than 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.

How do I use VLOOKUP with INDEX and match? ›

You may use VLOOKUP when the data is relatively small and the columns will not be inserted/deleted. But in other cases, it is best to use a combination of INDEX and MATCH functions. You use the following syntax using INDEX and MATCH together: =INDEX(range, MATCH(lookup_value, lookup_range, match_type)) .

How do you do a VLOOKUP with multiple answers? ›

Follow these steps to use VLOOKUP with multiple values:
  1. Create a specific helper column on the table's left. ...
  2. Type your starting formula in the specific cell. ...
  3. Add the multiple search values. ...
  4. Input the table array. ...
  5. Pick a range lookup option.
Sep 28, 2022

When should you avoid indexing? ›

When Should Indexes Be Avoided?
  1. Indexes should not be used on small tables.
  2. Indexes should not be used on columns that return a high percentage of data rows when used as a filter condition in a query's WHERE clause. ...
  3. Tables that have frequent, large batch update jobs run can be indexed.

How much faster is INDEX match than VLOOKUP? ›

With sorted data and an approximate match, INDEX-MATCH is about 30% faster than VLOOKUP. With sorted data and a fast technique to find an exact match, INDEX-MATCH is about 13% faster than VLOOKUP. Additionally, however, you can use a version of the INDEX-MATCH technique to calculate MUCH more quickly than with VLOOKUP.

Why is my VLOOKUP not accurate? ›

Problem: The exact match is not found

Solution: If you are sure the relevant data exists in your spreadsheet and VLOOKUP is not catching it, take time to verify that the referenced cells don't have hidden spaces or non-printing characters. Also, ensure that the cells follow the correct data type.

What is the best use of VLOOKUP? ›

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.

Can you do VLOOKUP and match? ›

The MATCH function only returns the position of the value in the vlookup table array. read more and does not return the value. If the MATCH function cannot identify the position of the lookup_value in the table array, then the formula returns #N/A in the error value.

What is the difference between INDEX and match in Excel? ›

=INDEX() returns the value of a cell in a table based on the column and row number. =MATCH() returns the position of a cell in a row or column. Combined, the two formulas can look up and return the value of a cell in a table based on vertical and horizontal criteria.

Can I have 2 conditions on a VLOOKUP? ›

VLOOKUP with two criteria. A usual VLOOKUP formula won't work in this situation because it returns the first found match based on a single lookup value that you specify. To overcome this, you can add a helper column and concatenate the values from two lookup columns (Customer and Product) there.

Can you have 2 lookup values in VLOOKUP? ›

You can't specify two lookup values in a VLOOKUP formula, so we'll need to use a workaround, which consists of two steps: Step1: Create a separate column where we will create unique lookup_values by merging our two lookup criteria – name and country – for example “MellaThailand“, “MellaNigeria“, etc.

What are pros and cons for indexing? ›

They have various advantages like increased performance in searching for records, sorting records, grouping records, or maintaining a unique column. Some of the disadvantages include increased disk space, slower data modification, and updating records in the clustered index.

What are the downsides of using indexes? ›

The downside to adding indexes to a table is that they affect the performance of writes. Moreover, improperly created indexes can even adversely affect SELECT queries! Any table configuration where performance suffers due to excessive, improper, or missing indexes is considered to be poor indexing.

Is there something better than INDEX match? ›

XLOOKUP was released by Microsoft in 2019 and is meant as the replacement for VLOOKUP, HLOOKUP, INDEX/MATCH functions.

What is the fastest way to VLOOKUP in Excel? ›

Approximate-match VLOOKUP is very fast

(VLOOKUP defaults to true, which is a scary default, but that's another story). With very large sets of data, changing to approximate-match VLOOKUP can mean a dramatic speed increase. So, no-brainer, right? Just sort the data, use approximate match, and you're done.

What are the common mistakes in VLOOKUP? ›

Most common VLOOKUP mistakes
  • Incorrect data – #N/A error. ...
  • Incorrect function name – #NAME? ...
  • Invalid VLOOKUP cell references – #N/A error. ...
  • Incorrect lookup range – #N/A error. ...
  • Incorrect column number – #VALUE! ...
  • Incorrect Number format – #N/A error. ...
  • Excess spaces and non-printing characters – #N/A error.
Nov 30, 2022

What is the main limitations of VLOOKUP function? ›

VLOOKUP disadvantages:

only provides data in a column. a single value must be in the row. data types should be the same in both columns. cannot lookup values from the left.

How do you explain a VLOOKUP in an interview? ›

VLOOKUP lets the user look for a value in the left-most column of a table. It then returns the value in a left-to-right way. It is not very easy to use as compared to the LOOKUP function. Meanwhile, the LOOKUP function enables the user to look for data in a row/column.

How do I lookup a value based on two criteria in Excel? ›

To do an Excel lookup with multiple criteria, you can use the INDEX and MATCH functions.
  1. The INDEX function can return a value from a specific place in a list.
  2. The MATCH function can find the location of an item in a list.
Jan 7, 2023

How to do a VLOOKUP in Excel for dummies? ›

  1. In the Formula Bar, type =VLOOKUP().
  2. In the parentheses, enter your lookup value, followed by a comma. ...
  3. Enter your table array or lookup table, the range of data you want to search, and a comma: (H2,B3:F25,
  4. Enter column index number. ...
  5. Enter the range lookup value, either TRUE or FALSE.

Should I use Xlookup instead of VLOOKUP? ›

The XLOOKUP defaults to an exact match where the VLOOKUP defaults to an approximate match. As the exact match is used most often, this setting would make the XLOOKUP more effective. On top of this, the XLOOKUP offers an additional option of an approximate match returning the next larger value.

Why would you use INDEX match in Excel? ›

The INDEX function can return an item from a specific position in a list. The MATCH function can return the position of a value in a list. The INDEX / MATCH functions can be used together, as a flexible and powerful tool for extracting data from a table.

What is INDEX match good for? ›

The INDEX MATCH function is one of Excel's most powerful features. The older brother of the much-used VLOOKUP , INDEX MATCH allows you to look up values in a table based off of other rows and columns. And, unlike VLOOKUP , it can be used on rows, columns, or both at the same time.

What does Xlookup do in Excel? ›

The XLOOKUP function searches a range or an array, and then returns the item corresponding to the first match it finds. If no match exists, then XLOOKUP can return the closest (approximate) match.

What is double VLOOKUP? ›

The VLOOKUP function looks for a value in the leftmost column of a table and then returns a value in the same row from a column you specify. By default, the table must be sorted in ascending order. So, the following is the syntax for the function.

Can you do a VLOOKUP with 3 criteria? ›

One common task you might need to do as an analyst is find data based on multiple conditions or criteria. VLOOKUP only allows you to lookup one specific value or criteria in a list of data.

In which cases INDEX and match is better than VLOOKUP or Hlookup? ›

When you're trying to look up a value based on a single input, you may be able to use a *LOOKUP function. If you're explicitly asked to find the location of a single input, or to look something up using two or more pieces of information, you'll need to use the MATCH and/or INDEX functions instead.

Why do people use INDEX match? ›

INDEX MATCH is a clever way to perform a two-way lookup in Excel by combining the power of the INDEX and MATCH functions. It is used as a workaround for the limitations of VLOOKUP, and offers great flexibility once you understand how it works.

What can I use instead of INDEX match? ›

XLOOKUP was released by Microsoft in 2019 and is meant as the replacement for VLOOKUP, HLOOKUP, INDEX/MATCH functions.

What is the disadvantage of VLOOKUP in Excel? ›

One major limitation of VLOOKUP is that it cannot look to the left. The values to lookup must always be on the left-most column of the range and the values to return must be on the right hand side. You cannot use the standard VLOOKUP to look at the columns and the rows to find an exact match.

Videos

1. Using Index and Match Functions To Look Up Values in Numbers (#1647)
(macmostvideo)
2. How to use Excel Index Match (the right way)
(Leila Gharani)
3. Stop using VLOOKUP in Excel. Switch to INDEX MATCH
(Excel Level Up)
4. Excel: Combining Vlookup and Match Functions
(Mike Thomas)
5. Excel Conditional Formatting the Lookup result in data table (Index Match)
(Leila Gharani)
6. VLOOKUP with MATCH Function in Excel | How to use MATCH Formula with VLOOKUP in Excel | 2D LOOKUP
(Innozant)
Top Articles
Latest Posts
Article information

Author: Tish Haag

Last Updated: 01/11/2023

Views: 5909

Rating: 4.7 / 5 (67 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Tish Haag

Birthday: 1999-11-18

Address: 30256 Tara Expressway, Kutchburgh, VT 92892-0078

Phone: +4215847628708

Job: Internal Consulting Engineer

Hobby: Roller skating, Roller skating, Kayaking, Flying, Graffiti, Ghost hunting, scrapbook

Introduction: My name is Tish Haag, I am a excited, delightful, curious, beautiful, agreeable, enchanting, fancy person who loves writing and wants to share my knowledge and understanding with you.