Comments on: INDEX & MATCH in Excel - better alternative to VLOOKUP

This tutorial demonstrates the key strengths of Excel's INDEX / MATCH function that make it superior to VLOOKUP. You will find a number of formula examples that will help you easily cope with many complex tasks when VLOOKUP fails. Continue reading

Comments page 17. Total comments: 614

  1. Hi
    I have downloaded Microsoft Templates file called "Sales invoice tracker" which has 4 key tabs which enables me to enter Customer details, Invoice details, Invoice summary and has a Invoice template tab. The file works great for recording all client information, client sales and creates the invoice via a dropdown list named (rngInvoice in the formula below) and referenced by the chosen job number in the "invoice" template. The formula has work fine until the ROW(1:1)) reaches ROW(13:13)) down the invoice page, i have reviewed the formula and for the life of me i cannot understand how this part of ROW works

    =IFERROR(INDEX(InvoiceDetails,SMALL(IF(InvoiceDetails[Invoice '#]=rngInvoice,ROW(InvoiceDetails)-ROW(InvoiceDetails[#Headers])), ROW(1:1)), MATCH($B$13, InvoiceDetails[#Headers], 0)),"")

    I have recreated a similar document but i am struggling with capturing and transferring data of multiple columns and rows via a single Job number column

    All i would like to do is select a Job number on the dropdown list on the "invoice" template and have the data from the "invoice details" with multiple columns and rows to be copied into multiple columns and rows on the invoice

    Please help

  2. Hi
    I have a file with 2 tabs, the first one has the customers name and the quantity that they ordered by style and on the second tab I also have the customer name and the style that they forecasted, I want to match the customer name and the style of the first tab with the second tab and return the value of the cell with the forecast quantity. I'm using the below formula, but it is not working
    =IFERROR(INDEX(Sheet2!$1:$65536,MATCH($A4:$B4,Sheet2!$C:$D,0),MATCH(D$3,Sheet2!$1:$1,0),1),0)

  3. Hi
    Anyone can help me to change this vlookup function to index mach?

    =IFERROR(VLOOKUP("*"&G:G&"*",'ADV. & LOAN'!B:D,2,FALSE),"")

  4. To be clearer in my last comment, "STREET" is the same as "Street", but is not the same as "Street.". (In my case, comparing addresses, " Lake St." is not the same as "LAKE ST" without the abbreviating period.)

  5. By the way, I did some experiments and even if you pick exact match (0), it is still case insensitive when you try to match.

    STREET is the same as Street.

    (Now if I could get a "fuzzy" match so that Road would match RD, wow!)

  6. could you please help me out on this scenario.

    SCENARIO

    IF cell D3 AND range F3:AJ3 ISBLANK(), THEN C3 =""

    IF cell D3 OR range F3:AJ3 is NOT BLANK , THEN MATCH values of cell D3 with Range F2:AJ2, whichever is MAX should show in cell C3.

    =IF(ISNA(OR(COUNTA(F3:AJ3)=0,(MAX(LOOKUP(2,1/(F3:AJ3""),$F$2:$AJ$2)<D3)))),IF(D3="","",D3),LOOKUP(2,1/(F3:AJ3""),$F$2:$AJ$2))

  7. Hi Svetlana,

    Can you kindly show us how we use this function between two worksheet but the excel book is same.I have tired it but i did not completely successful.

  8. Hi Svetlana,

    I'm dealing with a software that uses excel functionnalities, but can't support array functions. Do you know an alternate way of doing what an array formula does?

    Thanks,
    Félix

  9. Sorry the table collapsed!
    ……A………………………B………………………C………………………………D……………………………………………………E
    Alpha………………1234………………Here……………East Here…………………………………………2054
    East Here……2054…………………………………….Here…………………………………………………….1223
    Golf…………………4657…………………………………….North Here………………………………………2212
    Here…………………1223…………………………………….The North Here of Little Westerly…1235
    Juliet……………7511…………………………………….West Here…………………………………………5589
    North Here…2212
    Siera………………4651
    The North Here of Little Westerly……….1235
    West Here…………………………………………..5589

    Thank you

  10. Svetlana
    I have a large spreadsheet that contains a lot of information about thousands of locations. Each location has a unique 4 digit index number and a name. The name may not be unique but may be used in different locations such as North Here, South Here, East Here or “The North here of Little Easterly”. Some people know the location by the number and some people know the location by simply, in this case, “Here”. A simple lookup table can be used in the first instance for the unique number but what code must I use so that by entering the name, “Here” in a field, the code placed in stacked fields (say 6, one above the other) will pull up all results where the name “Here” is contained in the text in the field and report the unique location number in the adjacent field:
    A B C D E
    Alpha 1234 Here East Here 2054
    East Here 2054 Here 1223
    Golf 4657 North Here 2212
    Here 1223 The North Here of Little Westerly 1235
    Juliet 7511 West Here 5589
    North Here 2212
    Siera 4651
    The North Here
    of Little Westerly 1235
    West Here 5589

    Thank you

  11. Svetlana
    I have a large spreadsheet that contains a lot of information about many locations.
    Each location has a unique 4 digit index number and a name. The name may not be unique but may be used in different locations such as North Here, South Here, East Here or “The North here of Little Easterly”. Some people know the location by the number and some people know the location by simply, in this case, “Here”. A simple lookup table can be used in the first instance for the unique number but what code must I use so that by entering the name, “Here” in a field, the code placed in stacked fields (say 6, one above the other) will pull up all results where the name “Here” is contained in the text in the field and report the unique location number in the adjacent field:
    A B C D E
    Alpha 1234 Here East Here 2054
    East Here 2054 Here 1223
    Golf 4657 North Here 2212
    Here 1223 The North Here of Little Westerly 1235
    Juliet 7511 West Here 5589
    North Here 2212
    Siera 4651
    The North Here
    of Little Westerly 1235
    West Here 5589

    Thank you

  12. Sir, Still I am waiting for your positive reply.

    Binoy

  13. Dear Sir,

    I am trying to find value and display in answer columns but we are not success. please guide me.

    see the table.

    Sir I hope you reply as early as possible.

    Inst_Code course_code Vacant Inst_Code Course_Code Vacant Answer
    4 16 1 4 16 1 1
    4 16 1 4 16 1 1
    4 16 3 4 17 3 #REF!
    4 16 2 4 17 2 #REF!
    4 17 2 4 23 2 #REF!
    4 17 1 4 29 1 #REF!
    4 22 1 4 30 1 #N/A
    4 22 1 4 22 5 #REF!
    4 23 3 4 17 6 #REF!
    4 28 2 4 17 2 #REF!
    4 28 2 4 30 3 #N/A
    4 29 1 4 29 4 #REF!

    {=INDEX($A$2:$C$2,MATCH(1,(E2=$A$2:$A$13)*(F2=$B$2:$B$13),0),3)}

    Sir, I request you please reply as early as possible.

    Thanking you,

    Binoy

  14. Hi Svetlana,

    How can I use the INDEX and MATCH with a four dimensional look up (3 Vertical and 1 horizontal)? I tried extending the two dimensional example and it did not work.

    For Eg:

    January February March April
    Leather Black Big Bag 100 200 300 400
    Leather Red Small Bag 200 300 400 500
    Leather Green Big Bag 300 400 500 600
    Leather Yellow Small Bag 400 500 600 700
    Cotton Black Big Bag 500 600 700 800
    Cotton Red Small Bag 600 700 800 900
    Cotton Green Big Bag 700 800 900 1000
    Cotton Yellow Small Bag 800 900 1000 1100

    i want to write a formula to look up the value for the following :

    Cotton Green Big Bag January
    Cotton Red Small Bag March
    Leather Yellow Small Bag February

    Request your help please

  15. In the table under #calculations-index-match, you refer to a function that gets the row number of the maximum value as one that gets the row number of the minimum value and vice versa. Also, near the top of the page, you refer to "MATCH(lookup_value, lookup_array, [match_type])" as the syntax of the INDEX function.

    1. I did not realize there were so many "bugs" in this post. I should probably find a good proofreader... Thanks again for pointing out those errors for me.

  16. In the first paragraph below #index-match-basics, where is says "a combination of INDEX and VLOOKUP functions", I believe you meant "a combination of INDEX and MATCH functions".

    1. Hi Hank,

      Spot on :) Thanks very much, fixed!

  17. I am trying to create a spreadsheet where it will put a value from a table depending on the code entered and name of insurance provider. Would this be the best tool to use?

  18. Hello,

    I am trying write a function to count the number of unique values in one column that fall in a category in another column.

    Here is a simplified example of my data:

    Order Qty Group
    1 1 1
    2 2 1
    3 1 1
    4 4 1
    5 5 2
    6 8 2
    7 2 2
    8 4 2
    9 6 2

    I want to know how many different/unique order quantities there are within group 1, group 2, etc but without designating the cell range, just the particular value (1 or 2 in this case).

    Thanks so much!

  19. Q column A contains a series of data from 1 up to 100 numbers, while column B have data 1 upto 150 numbers but two times.compare A and B column then hilight matching ones. Thanks 4 ur comments

  20. Example:
    A B A+B Up-to-date
    1.00 2.00 3.00 3.00

    How can it be possible in the fourth cell to remain the value 3 even after editing A & B Cell Value as well as yield previous sum-total + Current sum-total effect in the same fourth cell.

    Say, if I delete the value 1 & 2 from A & B; A+B can be 0 but Up-to-date value will show 3 and again if I put 2 in A & 3 in B; A+B = 5 but Up-to-date value have to be 8

    A B A+B Up-to-date
    2.00 3.00 5.00 8.00

    No manual operation except putting value in A & B Cell rest are linked by formula. Please Help..

  21. Hi,

    I am trying to return multiple values using multiple lookup values. I have a range of lookup values, and I need to list the information from another sheet for each instances the any one of those lookup values appears on my data sheet. Suppose I had X,Y,Z for lookups, and I multiple data points for X,Y,Z on a another sheet. I need to create a single list that will show each entry that appears on the second sheet for any of X,Y,or Z. My current formula is:

    =IF(ISERROR(INDEX(Data!$A$1:$E$10000,SMALL(IF(Data!$D$1:$D$10000=Formulas!$A$2,ROW(Data!$A$1:$E$10000)),ROW(Data!1:1)),1)),"",INDEX(Data!$A$1:$E$10000,SMALL(IF(Data!$D$1:$D$10000=Formulas!$A$2,ROW(Data!$A$1:$E$10000)),ROW(Data!1:1)),1))

    That works fine, except that I have a list of 34 lookups in addition to Formulas!$A$2. Currently, it will only give me all the entries for the first lookup in my list. I can't figure out how to list the entries for the first lookup, then the second, etc.

    Thanks for any help you can provide.

  22. found the answer to my second question - it was my fault - had closed parenthesis in the wong place - so while formula was syntactically ok, it returned a wrong result.

  23. Thanks for the article which is a very helpful introduction into using index/match.
    One of the most interesting use cases (for me) is (or would be) using this index/match for looking up data in a (MS Excel) TABLE that resides not in the same, but in a different work book.
    I have played around with this and achieved some results, but also found that data is not refreshed and/or even not found anymore when the data in the table changes. My first question would be "what is the right syntax to use? and do I need a 2-way index/match for this or not"? So making up a simple example to illustrate:
    My workbook with the table holding the data is called 'CustomerFile.xlsx'. The table is located in tab sheet 'customers' and is called 'Table_Customer'. The columns on the table are: 'Customer ID' and 'Customer Name'. The table has two rows:
    Customer ID Customer Name
    -------------------------
    1 John
    2 Marc
    My workbook into which the result should be pulled is called 'CustomerRpt.xlsx'.
    So what formula would I be using to get the name of customer with ID 1 WHEN SPECIFICALLY WANTING TO USE TABLE AND COLUMN NAMES (rather than column references like $A:$A).
    =INDEX ('CustomerFile.xlsx'!Table_Customer[Customer Name], Match(1, 'CustomerFile.xlsx'!Table_Customer[Customer ID],0))
    OR
    =INDEX ('CustomerFile.xlsx'!Table_Customer[#Data], Match(1, 'CustomerFile.xlsx'!Table_Customer[Customer ID],0), Match("Customer Name", 'CustomerFile.xlsx'!Table_Customer[#Headers],0))
    My second question would be: "Any idea why sometimes a correct result is only returned when re-typing the complete formula from scratch?" Note: I am re-tying the EXACT same formula. I am aware the workbook with the source data needs to be open and I have tried refresh/refresh all, formula automatic refresh turned on, saving the file and coming back in, editing link and update values, but only retyping the formula brought back the correct result! So is there any caching going on?

    Thanks

  24. A B C D E F G H
    1 X AXN Ali 11.11 AXX Ahmed 10.19
    2 X AXT Hassan 13.19 AX9 Brian 11.11
    3 Y AXX Ahmed 10.19 AXP Shah 0.0
    4 Y AX9 Brian 11.11 AXN Ali 11.11
    5 Y AXP Shah 0.0 AXT Hassan 13.19

    Please help:
    Compare the value from Column "F" with Column "C" and on perfect match paste the corresponding average from Column "E" to Column "H". For example: AXX (F1) matches with C3 where the corresponding average is 10.19 and auto pastes it to last column i.e. H (H1)

  25. I have been practicing the formulas that (Look Up with Multiple Criteria Using Index/Match and Vlookup. and I have learned other two ways to lookup using index and match:

    =INDEX(Table9[[Customer]:[Qty.]],MATCH(1,((Table9[Customer]=B14)*(Table9[Product]=B15)),0),3) >Yours.

    =INDEX(Table9[[Customer]:[Qty.]],MATCH(B14&B15,Table9[Customer]&Table9[Product],0),3) _ Index/Match with &

    and using nested If function:

    =INDEX(Table9[[Customer]:[Qty.]],MATCH(B14,IF(B15=Table9[Product],Table9[Customer]),0),3)

    and the vlookup function with &:

    =VLOOKUP(B14&" "&B15,Table9,4,FALSE)

    these 3 formulas give the same results and I just want to share them.

    )))
    thank you for your time you put on explaining excel.

    my best wishes.

  26. please anybody resolve my problem.

  27. SHEET 1
    A B
    DATE NO.
    01-May-10 R/RES-105255
    02-Apr-14 R/RL-813301
    21-Jul-10 R/RES-148991
    02-Apr-14 R/RL-813301
    27-Oct-12 R/RL-557675
    21-Jul-10 R/RES-148991
    23-Jul-09 R/RES-100983
    30-Sep-12 R/RL-614014
    27-Mar-15 R/RL-574613
    27-Mar-15 R/RL-574563
    01-Jan-09 R/NN-53444
    04-Mar-15 R/RL-950289
    05-Feb-14 R/RES-100983
    01-Jan-09 R/NN-70988
    30-Sep-12 R/RL-614014
    30-Mar-15 R/RL-616791
    05-Jun-13 R/RL-610994
    11-May-11 R/RL-143811
    16-Feb-14 R/RL-824415
    01-Jan-09 R/NN-109879
    09-Nov-11 R/RES-30872
    01-Aug-13 R/RL-707247
    19-Jun-13 R/RL-727757

    SHEET 2
    A
    NO.
    R/RES-105255
    R/RL-813301
    R/RES-148991
    R/RL-813301
    R/RL-557675
    R/RES-148991
    R/RES-100983
    R/RL-614014
    R/RL-574613
    R/RL-574563
    R/NN-53444
    R/RL-950289
    R/RES-100983
    R/NN-70988
    R/RL-614014
    R/RL-616791
    R/RL-610994
    R/RL-143811
    R/RL-824415
    R/NN-109879
    R/RES-30872
    R/RL-707247
    R/RL-727757

    I WANT TO GET EARLIEST DATE IN SHEET2 COLUMN B FOR EVERY CELL WITH THE HELP OF SHEET 1

  28. Thanks for the valuable information.

  29. I have 3 columns of data.

    Column 1 - Vendor
    Column 2 - Items
    Column 3 - Price

    Data would look like this:

    Vendor A Item A Price $1.00
    Vendor B Item A Price $1.05
    Vendor C Item A Price $1.10
    Vendor D Item A Price $1.15
    Vendor A Item B Price $0.50
    etc

    It's a straight data dump from SAP; basically in column 4 (detailed as listed above) would be the formula that I'd like to find the min price for Item A (Data is in reality scattered throughout 1000+ lines and not next to each other.

    I was think a index/match/min formula to capture this but I can't figure the formula; any help would be appreciated!

  30. I have four columns of criteria. Some rows have four cells of criteria but some have only three. My formula is: INDEX(Fb,MATCH(1,INDEX((A4=SYSTEM)*(B4=SPECIE)*(C4=SIZE)*(D4=GRADE),0),0)). This works well as long as the row containing the match has criteria in all four cells but it fails when the correct match is in a row containing a blank cell. I need a method which will treat a blank cell as a match.

  31. Hi there, I really appriciate if you help me on vlookup on double values. I have purcasing # in one column and second column I have codes or numbers e.g., 30,20, 10 in a repetive way. I have to vlookup for anohter table that has purchasing # and codes and vlookup the 5th column that has comments. So I have to match purchasing # and code to other table and vlookup comments column.
    Hopefully i am clear.
    Ex:
    Purchacing # 1234567 code 20
    other table has the same data:
    Purchasing # 9876543 code 20 comments(column)
    Could you please kindly help to come up with formula.
    I inserted helping formula but I would like to use different formula without inserting any column. Plus I have a big data and vlookup can do up to 250 cells.

    1. You can concatenate the two columns on both spreadsheets directly to the left and do your match that way - I hope this comes across clear. If not, you can email me and I can send you my spreadsheet or modify yours

      spreadsheet1 spreadsheet 2
      '=VLOOKUP(J65&K65,$O$65:$R$67,4,FALSE) '=+S65&T65

      abc 10 test abc10 abc 10 test
      abcx 20 1 abcx20 abcx 20 1
      abc 30 three abc30 abc 30 three

  32. I have a registration/attendance form which contains list of people that attended the the occasion from day1 through day 5. If anyone attended or missed any day, I put "P" for present or "A" for Absent under the each day i.e Day1 Day2 Day3 Day4 Day5
    P A P P P
    Now, I want to find for each day, the list of people with "P". I used this formula: =INDEX(Registration!B10:B159,MATCH("P",Registration!N10:N159,0))

    On the first list for Day1, the first person (Row 1) registered was present, the second person (Row 2) was absent, the third person (Row 3) was present, and so on. Upon using the above formula, I got the name of the 1st person who was present, it skipped the 2nd person since he was absent but it put the name of the 3rd person in the 2nd and 3rd row. That is:
    Larry
    Daniel
    Daniel

    I want the formula, first not to repeat names, but to skip to next as long as the person is absent. I need help.
    Thank you.

  33. Hi guys.,

    I need ur help.... I made 1 time table, now i want to show the names of employees who are on leave in remarks column when i put "L" in corresponding cell...

    Thank in advance

  34. Hi.! Guys.,

    I made one time table using Vlookup, conditional formatting and some other functions.... Now i want to show the names of those employees who are on leave (sick leave, anual leave etc...) in remarks cell.

    Any one can help me in this tegard.???

    Thanks in advance .......

  35. how to match similar amount in different coloum different row

  36. I required solution while choosing motor rating which is standard as per their kw rating. I am doing pump calculation & finally I am getting certain value. e.g. after pump calculation I am getting 2.3kW rating. But as per manufacturer standards I nned to select one size higher motro from following column as below. For my case the selection should be 3kW.

    KW
    1.1
    1.5
    2.2
    3.0
    3.7
    Please suggest

  37. HI,
    =IF(AND(D54>=35,E54>=35,F54>=35,G54>=35,H54>=35,I54>=35),"PASS","FAIL")
    THIS IS THE FORMULA FOR DISPLAY PASS OR FAIL STUDENTS IN THE LIST. SO I WANT TO KNOW THAT, CAN WE USE THE CELLRANGE INSTEAD ONE BY ONE.
    HELP ME.

  38. Hi,

    the value that i try to match is the combination of text,-(hyphen) and number, eg. www-f-111. I noticed that they only match the www and return a result.

    Anyway that my match criteria included text, hyphen and number?

    Thanks in advanced.

    1. Put "" around it. So use "www-f-111"

  39. Hi

    I am trying to use the INDEX MATCH function with multiple match criteria but wanting to also to use the Match Type 1. Here's my attempt

    INDEX([Rate],MATCH(1,([From Ccy]=$F3)*([To Ccy]=$G3)*(Date]=$H3),1)

    I have a table with columns [Date], [From Ccy], [To Ccy] and [Rate]

    I'm trying to retrieve an FX rate for a particular [From Ccy] matching F3 and [To Ccy] matching G3, getting the [Rate] from the row with the largest [Date] less than or equal to H3.
    If I put the ([Date]<=$H3 then it retrieves the first row it finds, not the largest but less than or =

    Any ideas ?

  40. A
    1
    2
    3
    4
    5

    A B C D Result
    a 1 2 3 1
    b 1 4 3 1
    c 4 5 6 4

    I want to check the horizontal values with the vertical values, at least one match is enough

  41. Data range is given below. I am looking for formula while helps me
    in looking up name against same value.

    Data Range:

    B2:B4 C2:C4
    John 1
    George 2
    Stephen 2

    Where Required:

    B7:B9 C7:C9
    1 ?
    2 ?
    2 ?

  42. Hi!
    I wanna know how to detect a label and copy all the data column from the label detected I have something like that...

    sorry but I don`t have any idea to do it .-.

    A B C D
    1 vvcf vvcvc vcfvdf Icfgg
    2 0 -0.25 0.48 -0.11
    3 0 -0.25 0.48 -0.11
    4 0 -0.25 0.48 -0.11
    5 0 -0.25 0.48 -0.11
    6 0 -0.25 0.48 -0.1
    7 0 -0.25 0.48 -0.11

  43. Great! Index Match with your explanatory examples - solved my excel issues. Thank you!

  44. REGARDING: Look up with multiple criteria using INDEX MATCH
    Your formula on 2 criteria works but to check that i understand WHY it works recreated your example in my Excel 2010 and I entered in a separate cell:

    ={(A2='Lookup table'!$A$2:$A$13)}

    expecting it to evaluate to 1 or TRUE. However it evaluates to FALSE so although your overall formula works it shouldn't? both of the tests need to evaluate to 1 for it to find a match (zero * anything is zero or FALSE?)

    Can anybody shed light on this?

    1. I am also experiencing the same thing and using Excel 2010. Could this be an Excel 2010 issue?

  45. Thanks a lot!

  46. We have a pricelist that looks like this, each section is a drop down - so thickness and height has multiple selection and select no required has 8 off, 12 off, 24 off, 50 off, 150 off. I want to somehow when the customer selects each thing they want in the two cells it returns the price.

    SELECT THICKNESS & HEIGHT
    75 x 75 x 3 x 4M

    SELECT N0. REQUIRED
    8off
    PRICE

    No Product Price
    8off 75 x 75 x 3 x 4M 147.63
    12 off 75 x 75 x 3 x 4M 146.33
    24 off 75 x 75 x 3 x 4M 145.03
    50 off 75 x 75 x 3 x 4M 144.35
    150 off 75 x 75 x 3 x 4M 143.94

    Can anyone help? Thanks

  47. Hi
    How to get the year from the example "How to use INDEX MATCH to search by row and column values" ?
    I would like to have the year 2015 on the header as a return value when looking for the number 321,225.

  48. I keep getting a #N/A error.
    I tried VLOOKUP and MATCH and it returned results but only after checking 64 cells.

    =VLOOKUP(U4, 'Sheet1'!$A$1:$E$79, MATCH(T4,'Sheet1!A$1:E$1, 0), FALSE)

    So then I went to INDEX MATCH and still returning #N/A
    I have a Volume and MarketShare that need to be looked up and a dollar amount that needs to be returned.
    The grid is on another sheet...
    =INDEX('Sheet1'!A1:E79,MATCH(U4,'Sheet1'!$A$1:$E$79,MATCH(T4,'Sheet1'!$A$1:$E$1,0)))

    What am I doing wrong?

    There is an IF(AND) statement attached to the T column but like I said it was not a problem when I used VLOOKUP

    Thank you in advance

  49. Brilliant explanations, thank you.

  50. Dear,
    I am working in a transport company so i have to keep trips record up to date with the trucks numbers.so many times i have used your published formulas.
    Now i need a formula to show the trucks in separate sheets "loaded & unloaded" only to put the loading and unloading dates.
    if you will see, i can send you the file

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)