Ravindra BagaleCourses & study guides मराठी Track your progress

4. Lookup Functions

4.4 INDEX and MATCH

INDEX and MATCH with example — in 30 seconds

What: MATCH finds the row number of a value. INDEX returns the value at that row from any column.

Why: Unlike VLOOKUP, it can look left, and inserting a new column does not break it.

Tiny example: BLK-KOP-01 is in row 5 of the Store IDs, so INDEX returns row 5 of the managers: Rani. =INDEX(Stores!$E$2:$E$8, MATCH(G2, Stores!$A$2:$A$8, 0))

First look at the data (before → after):

INDEX and MATCH with example: before and after tables, fictional FreshGo Maharashtra data

Expected result — City Manager for each order

G: Store ID MATCH result Q: City Manager
BLK-KOP-01 5 Rani
AMN-SLP-01 6 Salman
BLK-SBN-01 7 Raja

About this data: Teaching sample for a fictional shop “QuickCart Delivery”. Figures and names (e.g. Meera Joshi) are made up for this lesson on index and match.

Before table and formula as text

Before — Stores sheet (A: Store ID … E: City Manager)

A: Store ID C: City D: Area E: City Manager
BLK-PUN-01 Pune Kothrud Ravindra Bagale
BLK-PUN-02 Pune Hinjewadi Shraddha Bagale
BLK-NSK-01 Nashik College Road Zoya
AMN-NGP-01 Nagpur Dharampeth Amir
BLK-KOP-01 Kolhapur Rajarampuri Rani
AMN-SLP-01 Solapur Murarji Peth Salman
BLK-SBN-01 Sambhaji Nagar CIDCO Raja

About this data: Demo table only — not real customer or company data. Built to practise index and match.

Formula / click path

Q2: =INDEX(Stores!$E$2:$E$8, MATCH(G2, Stores!$A$2:$A$8, 0))
MATCH(…,0) = exact match → row number

Do it step by step:

  1. First test MATCH alone: type =MATCH(G2, Stores!$A$2:$A$8, 0). You get a row number.
  2. Now wrap it: =INDEX(Stores!$E$2:$E$8, MATCH(G2, Stores!$A$2:$A$8, 0)).
  3. Press Enter and copy down.
  4. Insert a new column in Stores. The formula still returns the manager.
  • =INDEX(array, row_num, [column_num]) returns the value at a position.
  • =MATCH(lookup_value, lookup_array, [match_type]) returns the position of a value; match_type 0 = exact, 1 = largest ≤ (sorted ascending), -1 = smallest ≥ (sorted descending).

Together: MATCH finds the row, INDEX returns the value.

=INDEX(Stores!$E$2:$E$8, MATCH(G2, Stores!$A$2:$A$8, 0))
Step Result for G2 = AMN-SLP-01
MATCH("AMN-SLP-01",Stores!$A$2:$A$8,0) 6
INDEX(Stores!$E$2:$E$8,6) Salman

About this data: Made-up rows so you can copy the pattern for index and match. Currencies may use ₹, £, € or $.

Left lookup (VLOOKUP can't): find the Store ID of the Area "Dharampeth":

=INDEX(Stores!$A$2:$A$8, MATCH("Dharampeth", Stores!$D$2:$D$8, 0))    → AMN-NGP-01

Advantages of INDEX + MATCH over VLOOKUP: looks left or right; inserting/deleting columns doesn't break it; you can reuse one MATCH in many INDEX formulas (faster on big data); works in every Excel version.

Ravindra Bagale's Tip

In INDEX + MATCH, many students forget the final 0 of MATCH – then the default 1 (approximate) applies and you get the wrong row on unsorted data. Also, the INDEX range and the MATCH range must start from the same row (both from row 2). Keep these two rules in mind, and INDEX MATCH is very simple.

Practice task

With INDEX + MATCH: return the Platform for each Store ID; find the Store ID for the manager "Rani" (left lookup); return the Area for Store ID in cell J1.

Loading practice tasks...

  1. Row of a store (Easy): Find the position of "BLK-KOP-01" in A2:A8.
  2. Value by position (Easy): Get the 5th value of E2:E8.
  3. Results: position of Ravina (Easy): Find the position of "Ravina" in Students!B2:B5.
  4. Results: 2nd mark (Easy): Get the 2nd value of Students!D2:D5.
  5. INDEX and MATCH together (Medium): Find the City Manager of the store in H2.
  6. City of a store (Medium): Find the City of BLK-NSK-01.
  7. Results: marks of Salman (Medium): Find the Marks of "Salman".
  8. Results: class of Shahrukh (Medium): Find the Class of "Shahrukh".
  9. Look to the left (Hard): Find the Store ID of the manager "Raja".
  10. Results: roll no of the 85 scorer (Hard): Find the Roll No of the student with 85 marks.

Quick revision cards

Three standalone cards. Each one explains the idea with its own example. Scan the QR to open this lesson.

Revision card 1: What is Index And Match?
Card 1: What is Index And Match? · Download PNG
Revision card 2: Tiny example — Index And Match
Card 2: Tiny example — Index And Match · Download PNG
Revision card 3: Checklist — Index And Match
Card 3: Checklist — Index And Match · Download PNG