Note: The other languages of the website are Google-translated. Back to English
English English

Two-way lookup with INDEX and MATCH

To search for something across both rows and columns in Excel, or we say to lookup a value at the intersection of the specific row and column, we can use the help of INDEX and MATCH functions.

two way lookup with index and match 1

How to perform a two-way lookup with INDEX and MATCH?

To fill in the information about the sales made by Samantha during the month of July in the cell H7 as shown above, you can use the MATCH function twice to get the row (name) and column (month) numbers. The INDEX function will then retrieve the sales from the sales range based on the location numbers supplied by MATCH. (Note that the row number goes ahead of the column number in an INDEX formula.)

Generic syntax

=INDEX(return_range,MATCH(lookup_vertical_value,lookup_vertical_range,0),MATCH(lookup_horizontal_value,lookup_horizontal_range,0))

  • return_range: The range where you want the combination formula to return the sales from. Here refers to the sales range.
  • lookup_vertical/horizontal_value: The value MATCH used to locate its row or column number. Here refers to the given month and name.
  • lookup_column/row_range: The range of cells where the lookup_vertical/horizontal_value is listed. Here refers to the month and name ranges.
  • match_type 0: Forces MATCH to find the first value that exactly equals to the lookup_value.

To find the sales made by Samantha during the month of July, please copy or enter the formula below in the cell H7, and press Enter to get the result:

=INDEX(C5:E10,MATCH("Samantha",B5:B10,0),MATCH("July",C4:E4,0))

Or, use a cell reference to make the formula dynamic:

=INDEX(C5:E10,MATCH(H4,B5:B10,0),MATCH(H5,C4:E4,0))

two way lookup with index and match 2

Explanation of the formula

=INDEX(C5:E10,MATCH(H4,B5:B10,0),MATCH(H5,C4:E4,0))

  • MATCH(H4,B5:B10,0): The MATCH function finds the position of Samantha, the exact value in the cell H4, in the range B5:B10. So it will return 3 since Samantha is at the 3rd position of the list.
  • MATCH(H5,C4:E4,0): The MATCH function finds the position of July, the exact value in the cell H5, in the range C4:E4. So it will return 2 since July is at the 2nd position of the range.
  • INDEX(C5:E10,MATCH(H4,B5:B10,0),MATCH(H5,C4:E4,0)) = INDEX(C5:E10,3,2): The INDEX function retrieves the value at the intersection of the 3rd row and 2nd column in the sales range C5:E10, which is the value in the cell D7, $30,051.

Related functions

Excel INDEX function

The Excel INDEX function returns the displayed value based on a given position from a range or an array.

Excel MATCH function

The Excel MATCH function searches for a specific value in a range of cells, and returns the relative position of the value.


Related Formulas

Two-way approximate match with multiple criteria

In this tutorial, we will talk about how to look for an approximate match based on multiple criteria listed both in columns and rows in an Excel spreadsheet, with the help of INDEX, MATCH, and IF functions.

Multiple-criteria lookup with INDEX and MATCH

When dealing with a big database in an Excel spreadsheet with several columns and row captions, it’s always tricky to find something that meets multiple criteria. In this case, you can use an array formula with the INDEX and MATCH functions.

Left lookup with INDEX and MATCH

To find out information listed in the left columns in an Excel spreadsheet about a given item which is at the right side, you can use the INDEX and MATCH functions. The combination of the two functions possesses an advantage of looking up values in any column over another Excel’s powerful lookup function, the VLOOKUP.


The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.
Ribbon of Excel (with Kutools for Excel installed)

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Firefox, And New Internet Explorer.
Screen Shot of Excel (with Office Tab installed)
Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
List Status In Transit Vacant Emb
13001 13002 13001 13003
13002 13005 13004 13006
13003 13008 13007 13018
13004 13011 13010
13005 13014 13013
13006 13017 13016
13007 13020 13019
13008 13023
13009 13026
13010 13029
13011 13032
13012 13035
13013 13038
13014
13015
13016
13017
13018

Would it be possible to return the header ( In Transit/Vacant/Emb) on the status list?
This comment was minimized by the moderator on the site
Hi there, sorry that I don't quite understand you. Could you please attach a picture or file?

Amanda
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations