Skip to main content

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

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ...
Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup...
Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List...
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Description


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, Edge and Firefox.
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
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations