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 12. Total comments: 614

  1. hello
    Dear Svetlana,
    If i have three condition can i make the formula like :
    =INDEX(Sheet1!$G$2:$G$71,MATCH(C$4,Sheet1!$C$2:$C$71,0),MATCH($B6,Sheet1!$E$2:$E$71,0),MATCH($A5,Sheet1!$D$2:$D$71,0))

  2. Dear Svetlana,

    three days ago I stopped on your website and found very useful information about excel.
    I tried to find solution for my case(VLOOKUP,INDEX MATCH)but without success.
    Maybe you can help me ?
    I have two tables. First table which is in one sheet has 2 columns(1.ident number of product and 2.quantity).
    Second table which is in another sheet has also 2 columns(1. ident number of product and 2. price)
    Numbers of products(in raws) in first table are larger than the numbers in second table and first table includes all products(raws) from second table.
    How I can multiple quantity and price from theese tables ?

    Best regards,
    Krešo.

  3. hello

    I need help, I have 3 different suppliers for same products with different Artikel number and product name but with the same barcodes.
    Some of the product is cheap by the supplier number one but some the products are cheap by the supplier number 2 or 3.

    Now my question is this: Each supplier have more than 2000 products and it is very difficult to go one by one to find out who is selling for a good price and which product from three different suppliers.

  4. Hi,
    I have a Table 'Project Register' and within it I have 3 fields/columns - Client, Program, and Project. There are also fields set as named ranges for the above, using a validation formula to return valid options (working fine).

    My issue is the below formula returns NA# instead of an array of row numbers where the fields are blank, or when they match one or more criteria. (IE; All = ""; Program and Project are blank when client is selected; OR when Client and Program are selected, but Project is blank)... I can't see where the formula has gone wrong. Evaluation step through shows ok to the point of returning the row numbers. Your assistance is appreciated.

    =IFERROR(INDEX(Project_Register[Project Name],
    IF((Client="")*(Program="")*(Project="")),1,
    IF((Project_Register[Client]=Client)*((Program="")*(Project="")),1,
    IF(((Project_Register[Client]=Client)*(Project_Register[Client Program]=Program))*(Project=""),1,
    IF((Project_Register[Client]=Client)*(Project_Register[Client Program]=Program)*(Project_Register[Client Project Name]=Project),1,0)))),ROW(Project_Register[Project Name]),0),"")

  5. Very helpful, thank you!!

  6. Clarification: the formula I posted above references column "B" multiple times. That is actually on another tab in the spreadsheet and is where I'm placing the results of the formula.

  7. I'm trying to create a unique list of names, from two columns containing names, but only include names that fall between a date range. Example, column A has dates, column B has a name, and column C may (or may not) has another name. Given a Start date and an end date in some other cell (say in J1 and M1), is there a formula that will return a list of unique names from both columns B & C (same names may be included in both columns, but are never the same on the same row), that have a date that is within the given date range? I've been able to get the unique list of names using this formula ("Salesperson1" and "Salesperson2" are named ranges equivalent to columns B & C in my example above):
    {=IFERROR(IFERROR(INDEX(Salesperson1,MATCH(0,IF(ISBLANK(Salesperson1),1,COUNTIF($B$3:B3,Salesperson1)),0)),INDEX(Salesperson2,MATCH(0,IF(ISBLANK(Salesperson2),1,COUNTIF($B$3:B3,Salesperson2)),0))),"")}

    Any help would be appreciated.

  8. -20%
    -25%
    -27%
    -23%
    -19%
    As above I have a number of values and I want to reduce an array of values say by 7
    The result becomes
    -13%
    -18%
    -20%
    -16%
    -12%
    What formula can I use in excel to get this value ?

  9. Hi

    I have two columns in a file. Date (Column A) and Amount (Column B)
    Date Amount
    8/22/2016 600
    8/23/2016 600
    8/24/2016 200
    8/25/2016 800
    8/26/2016 600
    8/27/2016 600
    8/28/2016 600
    What I want to achieve is described below.

    In another sheet, I have certain dates. Not all the dates from above, but specific dates as below. And what I want to achieve through a formula is what is under column Sum.
    Dates Sum
    8/23/2016 =600+600
    8/25/2016 =200+800
    8/28/2016 =600+600+600

    I'll explain the formula I want taking 8/28/2016 as an example.
    I have calculated the sum until 8/25/2016. So I want to look at the data
    from the next row after 8/25/206 until the date specified here, that is 8/28/2016 and then sum it up.

    If I take 8/25/2016 as an example, then I have calculated the sum until 8/23/206. Hence I would have to pick up the numbers from the row below 8/23 (from the data) which is 8/24 until 8/25 and then sum that up.

    Can someone please help me with this?

    1. Sorry, I figured it out!! :-)

      =SUM(INDIRECT("Attendance!E" &Match(A22,Attendance!$A$1:$A$842,1)& ":E" &Match(A23,Attendance!$A$1:$A$842,1)))

      Cell reference here doesn't really match the example data I have given above, but you will get the concept

      1. Correction, you need to add a + 1
        =SUM(INDIRECT("Attendance!E" &(Match(A22,Attendance!$A$1:$A$842,1)+1)& ":E" &Match(A23,Attendance!$A$1:$A$842,1)))

  10. Hi

    Thanks for this article. I want sum of all results that are there in selected data from index match instead of single result.
    =INDEX('LR CashFlow'!$B$2:$F$561,MATCH(1,('LR CashFlow'!$B$2:$B$561='LR CALC SHEET'!B8)*('LR CashFlow'!$F$2:$F$561='LR CALC SHEET'!$D$6),0),3).

    Can you kindly help me in this.

    Thanks

  11. Hi I am trying to find a value in Column A and I know the value in Colum B.

    For example, I have placed a value from Column B, cell B10 in a parallel sheet. next to that I want to place the value of column A, cell A10. can I please have any advise on this ?

    1. Please do not respond to this , I have reached the solution !

      Thanks :)

  12. My question is, is there a way I can create a formula that will pull out code words from a variety of words that are listed in a cell? I have a column in which notes are listed but I would like to be able to find trends by using a formula to count key words listed within the notes.

  13. Please help. I want that the result would be like this:

    RESULT: Cell A4 is Letters with "No". Cell A5 is: B,C,F,K

    DATA:
    Cell A1 is A, B1 is B, C1 is C,...up to Q1 is Q. Cell A2 is Yes, B2 is No, C2 is No, D2 is Yes, E2 is Yes, F2 is Yes, G2 is Yes, H2 is Yes, I2 is Yes, J2 is Yes, K2 is No,...up to Q2 is No.

  14. Dear Svetlana,
    My Data Table Is Like :

    From Per To Per Marks

    -40.01 -999 0
    -30.01 -40 20
    -20.01 -30 30
    -15.01 -20 40
    -10.01 -15 55
    -8.01 -10 70
    -5.01 -8 90
    0 -5 100
    0.01 5 100
    5.01 8 90
    8.01 10 80
    10.01 15 65
    15.01 20 55
    20.01 30 45
    30.01 40 35
    40.01 999 15

    I have Value Like :

    Per Marks
    -20.83 ?
    10.53 ?
    13.64 ?
    -3.35 ?
    1.63 ?
    32.14 ?
    8.33 ?
    6.67 ?
    2.08 ?
    2.00 ?
    8.33 ?
    20.19 ?
    -6.45 ?
    3.27 ?
    -2.17 ?
    0.00 ?
    28.35 ?
    0.00 ?

    I want Answer On "?"
    I want to look "Per" in upside table.
    Plz Give me formula for this

  15. Dear Svetlana,

    I wonder if you might help with a problem…I’m not sure what I’m trying to do is possible.

    I have a ‘Lookup’ worksheet with a simple three column setup
    A B C
    WARD TRADEAS CPAddress
    1 ERNEHL Shop 1 Address 1
    2 PLAINS Restaurant 2 Address 2
    3 BSTALB School B Address 3
    4 GEDLNG Shop 2 Address 4
    5 CARLTN School B Address 5
    6 BSTALB Shop 3 Address 6
    7 NETHFD Shop 4 Address 7
    8 NETHFD Restaurant 3 Address 8
    9 NETHFD Shop 5 Address 9
    10 PHOENX Restaurant 4 Address 10

    I then have officers that cover particular ward(s)…so:-

    Officer A covers PHOENX, PLAINS and ERNEHL
    Officer B covers NETHFD, BSTALB, GEDLNG and CARLTN

    What I was trying to do was to search the ‘Lookup’ worksheet for all establishments assigned to Officer A (i.e. those with a WARD code of PHOENX, PLAINS and ERNEHL) and then return the resulting list of establishments and addresses (Column B and C) into a second worksheet (so giving a list of establishments to be inspected)…and them similarly repeat this for Officer B.

    Any pointers as to how I would achieve this would be really gratefully received

    Many thanks

    Brendan

  16. I appreciate it if somebody help me:
    I have two different excel files X and Y. In file X there are column "Date" with format of ("e.g January 1,2012") and column "Time" with format of (" e.g 1 a.m to 1:59 a.m") . in file "Y" I have three columns: "Date"(same format of file X) ,"Time" (format of 1 a.m that means 1 a.m to 1:59 a.m) and column "Amount". I want to first compare column "Date" in two files and see if they are matched then compare their appropriate "time" and see if their time are matched, then bring the appropriate "Amount" from file "y" to file X in a new column. note: time format in two files are different.

  17. Very useful information.. Thank you for sharing

  18. Hi, got a simple question. In your example of "Look up with multiple criteria using INDEX MATCH," the customer/product/qty example, how would you write a INDEX MATCH formula to average the Biscuits quantities?

    1. Hi Jason,

      I believe it's easier to do with the AVERAGEIF formula like this:

      =AVERAGEIF(B2:B10, "biscuits", C2:C10)

      Where B2:B10 are products and C2:C10 are quantities.

  19. hi !

    i need tot know How to VLOOKUP with Multiple Criteria in different sheets if A1 = A:A & B2 = B:E,3

    Tnx!

  20. THANXXXXXXXXXXX.......FOR INDEX FORMULA

  21. Hello! I need to visually split "Pyramid" chart. I created one for one fiscal year but I need to have 2 fiscal years reflected on one pyramid with a vertical line in the middle. Can anybody help/show hot to do this?
    where I can send "snap-it" attachment?
    Thank you! :-)

  22. Instaded of using such cretical formula we can get these results just using Pivote table function " so could I know what's advantage of using Index & Match function over Pivote table"

  23. I'm having difficulty getting any of this to work for exactly what I'm wanting to do. I'm working with 2 spreadsheets: "2001 Base Data" (BD) and "Knowledge Occupations" (KO). I'm trying to pull data from BD into KO. In KO I have the Name in column D. In each successive column there is an OCC code (xx-xxxx). I'm trying to pull employment by matching the Name in column D and an OCC code with the name & OCC code in BD. BD has the name in column B and the OCC code in column C. I want KO to return the value from column F in spreadsheet BD.

    Any guidance that can be provided would be immensely appreciated.

    Thank you!

  24. Dear mam/sir i reading in vlookup formula but i did not clear so kindly that by example

  25. Hi there hope you could help me i have a problem to use index match formula i before i was using vlookup but each time i have pasted new report the formula stop working

    i have a tab with vendor list
    column A Document number
    Column B Vendor number

    and tab with vat input
    column A
    document number

    i need formula to go to vendor list match the document number with the document number from VAT list and return the vendor number from the vendor list which is next to the document number in this list.

    My formula = INDEX( VENDORLIST $A:$B, Match(VAT List $A2,VAT List A:A,0),2))

    this formula does not return the right vendor number.

    Can you please advise ?

    Thanks,
    Aleks

  26. Is there a way for me to copy the array formula to multiple cells without press ctrl + shift + enter at each cell? when i press shift+F9 an error appear "Excel run out of resource while attempting to calculate one or more formulas. as a result, these formulas cannot be evaluated".

  27. I am trying to set a spreadsheet so that if it looks up a table. There are three columns; size of timber, rate to charge and the rate charged in £.
    I want to set it so that if the size and rate match on my spreadsheet details I have inputted then it picks up the charge rate from the table and inputs it so I know what to charge based on the size and rate chosen.
    Help if possible!

  28. what are the scenario where we do use index and match?
    and what is If match_type is 1, MATCH finds the largest value that is less than or equal to lookup_value. Lookup_array must be placed in ascending order: ...-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE. In Match function

  29. Hi,

    A big thanks to anyone who can help with this.

    Column A
    14P3WSKK1637I35DM
    13A4P5FL7243G95126
    13A4CL1E5051I36B28
    13A4CL1E5051I09Q30
    13A4Y9GE50C733N32
    13A4DLES1206I90132
    14P4CWN5V3W5G24PS
    14P4CWN5V5Q5G24PSS

    Coumn B
    S
    SS
    28
    30
    32
    M

    Comumn C
    Small
    Extra Small
    Size 28
    Suze 30
    Suze 32
    Medium

    I have to search for the text from column B in Column A and return the corresponding value from Column C.

    Basically the last character or combination of the last two characters make up the size of the clothing.

    Thanks a million.

    Umar

  30. Svetlana, I enjoy your formulas explanations: very visual, very concise.
    I have a long formula I am using (was created my may manager). Formula works, but I'd like to find ways to make it shorter and more"elegant". Since the formula takes almost a page in Word, I'd like to pay you for a working solution. Must be for Excel 2010 & 2013. I use both for internal reasons on 2 computers.
    Thank you!

    1. Hi Olga,

      I am glad to hear you've found my articles helpful. Please send us a sample workbook with your original formula to support@ablebits.com and we will see if we can help. (To make sure your message immediately gets in the right hands, please refer to this comment or write something like "Att: Svetlana" in the subject).

  31. 4 4.25 4.5 4.75 5
    1.10 1.11 1.13 1.14 1.15
    1.08 1.09 1.10 1.11 1.12
    1.06 1.07 1.08 1.08 1.09
    1.04 1.06
    1.02 1.03
    1.00 1.01
    -22 212 233.2 235.9 238.5 241.2 243.8
    -21 206 226.6 229.2 231.8 234.3 236.9
    -20 200 220.0 222.5 225.0 227.5 230.0
    -19 194 213.4 215.8 218.3 220.7 223.1
    -18 188 206.8 209.2 211.5 213.9 216.2
    -17 182 200.2 202.5 204.8 207.0 209.3
    -16 176 193.6 195.8 198.0 200.2 202.4
    -15 170 187.0 189.1 191.3 193.4 195.5
    -14 164 180.4 182.5 184.5 186.6 188.6

    Hi,please see above which is driving me crazy. I have a number I want to match with row 1 (eg 4) and I have a value corresponding to the main table (eg 192.2) and I want it to give me the left hand column value nearest to (192.2) which in this instance would be -16. Is this possible please?

    1. Sorry, the row 1 item (4) is in cell C1 and the nearest number to 192.2 is 193.6 in cell c14 and I would like it to return -16 from cell A14.

      Hope that makes more sense.

  32. I am attempting to do a vlookup or an index/match function in excel to return a name of an organization. I want excel to look at a value in cell G24 and if it is # look in H24 and return a value from a separate tab or return a value from another tab if it is not a # in G24. In other words I am doing Vlookup,(G24,'Organization data,!A2:C229,2,0) and vlookup(H24,'fp'!A2:c926,1,0). Is it possible to combine that function to return a solution?

  33. I use sum(if(...) array formula to get the results from data for multiple conditions. Can Index(Search) option be used to replace this and get the count and sum from the table based on more than 2 criteria. fox ex. from a data of students, we want sum of boys having age <=10 and passed with more than 80%.

  34. Hi,

    I need help, let me know if you can fix my problem.
    Say I have Master Data:
    Col A Col B
    Book 123
    Book 60
    Pencil 50
    Pencil 100

    Than I expect summary table:
    Col A Col B
    Book 123
    Pencil 100
    The maximum of same index in Col A

    How can we make it in excel?

  35. Hi,

    I need to add prefix with as no of zero as required to the amount field till the lenth becomes 11 digit.

    For example, if amount field is 1000, then it prefix with 7 zeros as '00000001000' and if amount field is 10000, then it prefix with 6 zeros.

    1. Hi Shankar,

      Kindly right click on cells and select format cells. Now select format special and manually type 11 zeros (00000000000) in type box. Hope this will solve your requirement.

  36. thanks for clear and simple explanation. it s very usefull

  37. Hello Svetlana,

    Hope you can help me on this project.
    I did manage to get it resolved by using vlookup however, I need to know if there's another way to do it.

    Here's a dummy example:

    1. Detail Tab
    Status Account Amount
    No Budget Apple $100
    Budget Pear $200
    No Budget Apple $200
    No Budget Orange $300
    Budget Banana $100
    No Budget Orange $500
    No Budget Apple $200

    2. Summary Tab
    Account Amount
    Apple $500
    Orange $800

    So, all I need is to bring the results automatically of the No Budget account from the Detail Tab into the Summary Tab which in this example are the Apple and Orange and their total as well to show as one.

    Is there another formula I can use?

    Thanks very much in advance.

    Henry

  38. Svetlana,

    I was trying to adapt your tutorial to my needs with no success. I have a workbook with hundreds of worksheets. Each worksheet represents a computer. Every worksheet is identically laid out, with 10 columns but varying rows, and every column has similar information. I have a formula that looks like this: =COUNTIFS(C:C,"high",J:J,"Open") and it counts the cells that have a High severity rating AND a check state of Open. I am trying to figure out how to take those two criteria from a row and put the value of the cell in the same row of column D into a cell. Column D is the RuleID of a vulnerability. So it would look like this: IF the value in column C is "High", and the value of column J is "Open", then place the value of column D ("SV-32245r1_rule") in this cell. Can you help me?

  39. Team,

    Am stack trying to use the index function but return the results as a horizontal array instead of vertical? Any idea how I can achieve this?

    Elvis

  40. Hi Svetlana,

    Thanks for such awesome explanation on excel functions.

  41. I am trying to solve a problem where I have two rows. Row 1 has Product Names eg PD1, PD2, PD3, PD4. Row 2 has corresponding quantity. When products are ordered by customers, I am trying to summarise for each customer what products they have ordered such as PD1, PD4. I have a formula that works but it is too long and makes it difficult to add another product.
    =IF(ISBLANK(L6),"",$L$3)&IF(ISBLANK(M6),"",", "&$M$3)&IF(ISBLANK(N6),"",", "&$N$3)&IF(ISBLANK(O6),"",", "&$O$3

    Is there some way of seeing that the cell is not blank and returning the corresponding Product Name. Thanks

  42. Hello,

    Thanks for all the info and help! When I added the "IFERROR" to the beginning of my formula (INDEX AND MATCH formula and it was working perfectly prior to adding the iferror feature)it removed the $ format from the cell. I cannot seem to find a way to format the cell to show it as currency.
    Can you please help.

    Bill

  43. Hi,
    I need help with a a report.
    I currently have a tab for every month of the year. I am collecting the employee's names which change every month and I have a column that collections notes based on their monthly performance.
    I also have a tab which i currently have set it up to collect the data from each monthly tab to show all notes in one place.
    My issue is that when I update the name list, the notes collected in the freeflow area, do not move with the employee. This is causing more manual work on my part to re-enter the comments every month.
    I would like for the performance comments to follow the agent's name no matter where they land in column 1.
    Can you assist?

  44. Hi Svetlana,

    Excellent article! I stumbled across it recently in my search to solve a dynamic lists issue I've been battling for almost a week now. My scenario:
    I have several sheets in my workbook:

    Sheet 1 contains a list of locations
    Col1 Col2
    LocationName LocationID
    Syndey 1
    Melbourne 2
    Perth 3

    Sheet 2 contains a list of courses
    CourseName CourseID
    Course A 1
    Course B 2
    Course C 3

    Sheet 3 contains a list the sessions for all of the course:
    SessionName SessionID
    Session 1 1
    Session 2 2
    Session 3 3

    Sheet 4 contains a list of date dates each course is run in each location:
    Col1 Col2 Col3 Col4
    ScheduleID Ref to LocationID Ref CourseID CourseDate
    1 1 1 14/01/2014
    2 1 1 18/03/2014
    3 1 2 23/10/2014

    Sheet 5 contains a list of the dates for each session for each course date:
    Col1 Col2 Col3
    Ref to ScheduleID Ref to SessionID SessionDate
    1 1 14/01/2014
    1 2 15/01/2014
    1 1 18/03/2014
    1 2 19/03/2014
    2 1 23/10/2014
    2 2 24/10/2014

    Here's what I want to achieve:
    Col1 Col2 Col3 Col4 Col5
    Location Course CourseDate Session SessionDate

    1. User selects Location from dropdown list(Sourced from Sheet1).
    2. User selects Course from dropdown list(Sourced from Sheet2).
    3. CourseDate dropdown list filters to only show matches for the selected Location and Course(Sourced from Sheet4). User selects CourseDate.
    4. Sessions dropdown list filter to only show SessionDates for the matching ScheduleID and SessionID (Sourced from Sheet5).
    5. SessionDate to auto poplulate with the matching record from Sheet 5.

    My data is set up as per the examples above as it's near impossible to create a separate list for each combination.

    Any help on who I can achieve this in Excel would be great.

  45. Is there a way to do a 2-way Index Match Max? I've only seen things posted to find Max on a standard Index Max, but not on an Index Match Match.

  46. DHAVAL KAMLESH RAMESH KAPIL
    500 1500 1950 1950 1950 RAMESH AND RAMESH
    25 2800 85 100 2800 KAMLESH

    =+INDEX($B$2:$E$2,MATCH(MAX(B4:E4),B4:E4,0))

    IF HAVE SAME AMOUNT 2 PARSON THAN WHICH FROMULA USE

    PLZ HELP

  47. A fantastic intro to the amazing world of 'match and index'.
    Thanks you.
    Chuck

  48. I want use 15 min time interval values (like 15:00, 15:15, 15:30, 15:45 ...........) from A1 to A10 in a excel sheet and if the value is >0 (like 15) in B1 to B07 (actual range is B1:B10) so now I want to print cell values in A (ranges A1 to A10) based on B (ranges from B1:B10) in line chart graph. Please Help me.

  49. Hey Guys,

    Does INDEX and MATCH excel formulas help us to compare two columns and return me the data that is not there in the former coloumn.
    For ex :
    Template 1 has a PL column with row data GLCA:GLUS:GLOBAL:WCH2:WAS2:CHINA:AUST:GLEEMEA:GLUS
    Template 2 has a PL column with row data GLCA:GLUS:WCH2:WAS2:CHINA:GLEEMEA

    I want the data that is missing in template 2 but available in template 1.

    Let me know what formula is the best...

  50. HEELO SIR,
    I HAVE A ROW NAMED NET PRICE.
    ON RIGHT HAND SIDE I HAVE THREE TO FOUR RECOMENDED PRICE ADJACENT TO COMMISSION.
    NOW THE CONDITION IS IF MY NET PRICE MATCHES WITH RECOMENDED PRICE WE WILL GET COMMISSION AS PER THAT PRICE.SOMETIME MY 2 TO 3 RECOMENDED PRICE MATCHES WITH NET PRICE AND I WILL RECIEVE THE MAXIMUM COMMISSION FROM THAT RECOMENDED PRICE.

    I AM MENTIONING THE FORMAT OF EXCEL BELOW
    NET PRICE RECO.PRICE COMM RECO.PRICE COMM RECO.PRICE PROMO
    145 145 50 145 55 140 65

    NOW PLEASE GIVE ME THE FORMULA WHERE COMMISSION OF 55rs IS TO BE DISPLAYED AS THERE ARE 4 TO 5 LAKH ROWS SO IT IS NOT POSSIBLE TO CALCULATE TOTAL COMMISSION MANUALY.
    THANK YOU

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 :)