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

  1. Dear Alexander,

    1. I have two columns in Sheet1 having data wherever there is data in Column A there is no data in Column B and vicversa.

    I want to lookup both these value (both the columns) and get the result in one column i tried by following vlookup but not getting the result =vlookup(a2&22,'sheet2'!C$2$:D$56$,2,0)

    Kindly try and Help.

    2. Since i was not geeting the result with above i used vlookup in two different columns seperately for Column A and Column B as below

    =IFERROR(VLOOKUP(A2,'Sheet2'!$c$2:$D$100,2,0),"")
    =IFERROR(VLOOKUP(B2,'Sheet2'!$c$2:$D$100,2,0),"")

    Than concatenated both the columns =CONCATENATE(a2,b2) and got the result

    but my issue is wherever there is blank cell i need to input the text as OTHS so how do i achieve that.

    Need your help and support.

  2. Trying index/match or vlookup and not working. Value trying to match is A1= James Logan Howlett. Match range has A25 = Logan Howlett, James.

    =INDEX(B25:B29,MATCH(A1,A25:A29,0)

    i am having trouble figuring out how to "match" the two names. Data list is relatively short so vlookup, index/match or something else I am not familiar with? In the output I am getting in some cells data that does not match up with the match value or it returns #N/A.

    Thank you in advance.

      1. Thank you for the reply. Yes, this is the problem. Is there a solution? I have looked at wildcards and have not figured that out. Is there a formula that would allow the last names to be matched to one another? Is there a formula that would look at only "Logan Howlett" in one cell and match or vlookup it to the range containing "Logan Howlett"

        A formula that looks at "Parker" in Peter Parker and matches it, or vlookup to "Parker" in Parker, Peter? I have figured out how to match Peter Parker to P. Parker but the above scenario still has me stumped.

        Peter Parker > Parker, Peter
        James Logan Howlett > Logan Howlett, James

        I need both scenarios to work as some on the list have a second last name.

        1. Hello!
          Read the instructions on how to split full name to first, last, and middle name from string.
          This formula matches the name from column A to column B and returns the matching value from column C

          =INDEX(C2:C8,MATCH(1,ISNUMBER(SEARCH(LEFT(A2,SEARCH(" ",A2)-1),B2:B8))* ISNUMBER(SEARCH(MID(A2,SEARCH(" ",A2)+1,SEARCH(" ",A2,SEARCH(" ",A2)+1)-SEARCH(" ",A2)-1),B2:B8))* ISNUMBER(SEARCH(RIGHT(A2,LEN(A2)-SEARCH(" ",A2,SEARCH(" ",A2,1)+1)),B2:B8)),0))

          I hope it’ll be helpful.

  3. Hello!

    For index-match combination, is this possible to set the "lookup_value" inside match function to "a spill range"? My index-match formula works without any problem when lookup_value is a single value, however when I change that value to a spill range, result become #N/A. My aim is to expand the formula for each row on a table dynamically, within one single formulated cell.

  4. Hello! I need to output multiple values ​​with the same criteria, but it only outputs the first closest value. how can i complete the formula?

  5. I am trying to set up a golf spreadsheet. So I would have a column with all the player's names
    Then a Column with the scores. I then want excel to automatically select the first and second-highest scores.
    I did this with LARGE but if there is more than one score the same I need it to show all those players.
    65 Tom, 1st
    66 Jack John George, Second

    So excel pulls the score and player's names, including multiple players with the same score?

    1. Hello!
      You can get a sorted list of values using the UNIQUE function and SORT function.

      =SORT(UNIQUE(A2:A15),,-1)

      Write this formula in cell C2.
      Use the FILTER function to get a multiple values by condition.

      =TEXTJOIN(", ",TRUE,FILTER($B$2:$B$15,$A$2:$A$15=$C$2))

      =TEXTJOIN(", ",TRUE,FILTER($B$2:$B$15,RANK($A$2:$A$15,$A$2:$A$15,0)=ROW()-1))

      Write this formula in cell D2. After that you can copy this formula down along the column.
      I hope I answered your question. If something is still unclear, please feel free to ask.

  6. A B C D E
    At Admision Code - At admission Score - At discharge score - At discharge Score - At discharge Code
    IMBD0349 . 6 . ? . 2 . FSKA0306
    IMBD0350 . 8 . ? . 3 . SDBD0333
    IMBD0351 . 7 . ? . 5 . FSKA0308
    IMBD0352 . 9 . ? . 4 . IMBD0350
    FSKA0305 . 6 . ? . 8 . FSKA0305
    FSKA0306 . 8 . ? . 7 . JEID0044
    FSKA0307 . 7 . ? . 5 . IMBD0351
    FSKA0308 . 9 . ? . 3 . IMBD0349

    I want to match the column A code to column E Code after matching correct number should be automatically come to column C

  7. At Admision Code Gender At admission Score At discharge score At discharge Score At Discharge Code
    IMBD0349 Male 6 2 SDBD0332
    IMBD0350 Female 6 4 SDBD0333
    IMBD0351 Male 6 2 DJBD0012
    IMBD0352 Female 5 6 IMBD0350
    FSKA0305 Male 6 7 IMBD0351
    FSKA0306 Female 7 4 JEID0044
    FSKA0307 Male 5 3 HNRT0364
    FSKA0308 Female 6 6 HNRT0365
    FSKA0309 Male 6 5 FKRK0033
    HNRT0364 Female 5 2 URJE0044
    HNRT0365 Male 7 3 JFDK1123
    HNRT0366 Female 6 1 HNRT0367
    HNRT0367 Male 6 4 HNRT0368
    HNRT0368 Female 5 5 DFDD2322
    SDBD0332 Male 5 8 KIDK9922
    SDBD0333 Female 6 7 SDBD0335
    SDBD0334 Male 8 9 DLWW0098
    SDBD0335 Female 6 4 KDEK0088

    Match column A & F
    At discharge score column E
    match score should automatically come D column

    1. Hi!
      I can't guess what is written in column F and what values you want to match. Give an example of the expected result.

  8. Hi,
    What is wrong with this formula. Getting error #N/A.

    {=INDEX($AX$2:$BI$288,MATCH(1,(AB2=$AW$2:$AW$288)*(AS2=$AX$1:$BI$1),0))}

    1. Hi!
      The #N/A error means that the lookup value could not be found. But I can't see your data, so I can't tell you why.

      1. Hello Alex,

        Yes, I understand. but Data is there in my index range. when I debug formula $AW$2:$AW$288 return false value even though AB2 data is there.
        How can I copy data or snip data here.
        Please
        Thanks for your time and quick reply.
        ABC

          1. Hello Alex.
            yes, you are correct. updated and its works

            =INDEX($AX$2:$BI$288,MATCH(AB2,$AW$2:$AW$288,0),MATCH(AS2,$AX$1:$BI$1,0))
            Thanks,

  9. Thank you for all your help. Your service was excellent and very FAST. Many thanks for you kind and efficient service. I have already and will definitely continue to recommend your services to others in the future.

    1. 1 it is
      1.1 it is not
      1.1.2 it is not good
      plz search item 1.1.2 and combine in excel

  10. I have used this Index Match function quite a few times; however, I am seeing something today that I can't figure out. Here is the formula I am using: =INDEX(Table3[#All],MATCH(1,($B4=Table3[Part No])*($A4=Table3[Site]),0),MATCH("Std Costs",Table3[#Headers],0))

    The result is finding data on the table, but it is returning the value 1 cell above the value that is being searched for. I don't know what is happening.

    Thanks,
    Duayne

    1. Hello!
      Table3[#All] reference includes the entire table along with the header row. Here the first row is the headers, not the data. The rest of the links include only data without headers.
      I hope I answered your question. If something is still unclear, please feel free to ask.

  11. Thanks for your help and effort and providing same fiel with formulas. This is awsome.
    Keep the good work going on.

  12. Hi, your formula works fantastic for me! But get a zero in cells that has no data. How can I resolve this issue?
    This is the formula I am using
    =INDEX('B1'!$H$2:$H$3099,MATCH($C$18:$C$3115,'B1'!$B$2:$B$3099,0))

    Btw, I am a noob in this. Below was the original formula
    =INDEX('B1'!$H$2:$H$3099,MATCH(C18,'B1'!$B$2:$B$3099,0))
    It work fine, but when i copy to the rest of the same column below, no doubt the C18 will change accordingly but it shows the exact same info in the cell. However, when select the cell and click on the formula bar once and press enter, the info will change and it's accurate. Also, I don't know why when i move my cursor to the bottom right corner and when the + sign show up, I double click and nothing happen. It should duplicate the formula for the entire column right?

    Your kind advice will be very much appreciated!

    1. Hi Texx,

      I cannot imagine how it can be that the formula returns zeros in cells that have no data; for me it returns the #N/A error in this case. Anyway, this can be easily fixed by wrapping your formula in the IFERROR function, so that it returns an empty string (blank cell) when no match is found:

      =IFERROR(INDEX('B1'!$H$2:$H$3099,MATCH(C18,'B1'!$B$2:$B$3099,0)), "")

      Also, I'd suggest that you stick with the original formula that uses a single cell for the lookup value (C18). Using a range may cause very frustrating issues (#SPILL error) when migrating to Excel 365 or Excel 2021.

      Double-clicking the plus sign works as long as there is some data in the adjacent column(s). As soon as an empty row occurs, the auto fill stops. In this case, you can copy the formula down by dragging the fill handle (a small square at the lower right-hand corner of the cell). For more information, please see How to copy formula in Excel.

  13. I do not understand why my Index Match formula is not working. Skill level is low. "=INDEX($D$2:$D$1778,MATCH(B2,$C$2:$D$1778,0))"
    Col A | Col B | Col C | Col D
    #N/A | AHF,1KIT10 | ONDA2VIA2 | 14470
    #N/A | ANTI30002 | COVI30VI4 | 12404
    all the
    way

    1. Hello!
      The MATCH function cannot search in a two-dimensional range. It only works with a row or column.

  14. Looking to build a table that will use the following information I would like the table to place student name under a floor #, but if "John" lives on floor 1, he can not be entered on floor 1. It needs to skip to the next name. How can I do that?

    Floor Student
    1
    2
    3
    4
    5
    6
    7
    8
    9
    Students
    John
    Jeff
    Alice
    Jayne
    Bob
    Sherri
    Michelle

    1. Hi!
      I am not sure I fully understand what you mean. Is your data recorded in columns A and B? Show the intended result.

  15. This approach works great except when you want to use a wildcard like '*' or '?'. For examples, suppose we want to get the value for all with an 'n' in their Product Name. I would like to use a wildcard like '*n*' to get the result.

    The problem I am trying to solve is where I have data in a Table on a separate worksheet with four columns. Let's call them Column A, B, C, and D. On another worksheet I have a Table where I list criteria for various Organizations (let's call them Me, Myself, and I). This criteria table has the same columns of A, B, C, and D yet not all cells have data in them. So whenever data exists (including wildcard data like 131*, *3069, *.46.*) under one of these criterion Columns, I want to extract the data in the Cell for Column B of the first worksheet mentioned. I applied the concept and got good results using a Choose function to get the correct formula since an empty cell will cause the N/A error, and now the only problem is where a wildcard criterion exists. In other words, the formula on worksheet2 is

    =INDEX(Worksheet1[B],MATCH(1,INDEX((A3=Worksheet1[A])*(B3=Worksheet1[B])*(C3=Worksheet1[C])*(D3=Worksheet1[D]),0,1),0))

    If any criteria for [A], [B], [C], or [D] has a wildcard whose data does exist in the Table in Worksheet1, I get an N/A error.

    Worksheet1 Table:

    A B C D
    1 zrt cfre ghnt 123wro
    2 abd S.42.3 klmd qrsU47
    3 doq 1315600 plov 123wro

    Worksheet 2 Table:

    A B C D E F G
    1 *l* Me
    2 abd S.42.3 Myself
    3 131* 123wro I
    4 zrt *nt Me

    Notice that not every cell in the Worksheet 2 Table has data and the data that is there contains wildcards.

    In Column G of the Table in Worksheet2 I would like to extract the data in Column B of the Table in Worksheet1.

    Thoughts? Help?

    1. Hello!
      I don't quite understand what kind of result you want to get.
      ="nt*"="ghnt" --- The formula is wrong.
      To check if the substring "nt" is included in the text "ghnt", use SEARCH function

      =ISNUMBER(SEARCH("nt","ghnt"))

      If this is not the problem, explain what result you want to get from your formula.

      1. I think I understand what Frank is saying and I get the same issue. In Svetlana Cheusheva's last example above, if I put a wild cards "*" in front of Dan (customer name) to indicate anything containing "dan" it returns an #N/A, see formula below how the wildcards would be used.

        =INDEX(C2:C10,MATCH(1,INDEX(("*Dan*"=A2:A10)*(F2=B2:B10),0,1),0))

        In this formula example, imagine if there was a customer name that you wanted to pull that contained "dan" and not an exact match. How do you do it? Is there a workaround if you are trying to find a partial text in the table array. I tried with SEARCH and couldn't figure it out. Please help.

        1. Hello!
          To find the number of the cell that contains the text "Dan" use the formula

          MATCH(TRUE,ISNUMBER(SEARCH("Dan",A2:A10,1)),0)

          I hope I answered your question. If something is still unclear, please feel free to ask.

  16. This page is great! I use this all the time.

    This formula in the "How to use INDEX MATCH function in Excel" section requires one more close-parentheses at the end:

    CURRENT:
    -- INDEX (column to return a value from, MATCH (lookup value, column to look up against, 0)

    CORRECT:
    -- INDEX (column to return a value from, MATCH (lookup value, column to look up against, 0))

    Thank you for this column!

  17. I have been dealing with this problem for days and after reading blogs and syntax on Match and Index, I still have not found any solution to my formula #Ref! error.

    I have three worksheets, two(lets call them "Required" and "Actual" of which I want to calculate the sum of a specific column based on 3 criteria and populate the result on my "master_sheet". The 3 worksheets are composed of different number of columns and rows; Required = 6806 rows and Actual = 6142 rows.

    I need to create three columns (on master_sheet) based on one of the criteria (level of expertise) as follows
    Required_Expert|Actual_Expert|Required_Inter |Actual_Inter|Required_Beginner|Actual_Beginner|

    I have written the strings Expert, Intermediate, and Apprentice to serve as my lookup cell for one of the criteria and those levels are listed in the cells of a column in Required and Actual worksheets.

    The other criteria on the three worksheets are Position, Division and Total hrs(the values I want to sum)

    Here is the formula to find the sum of total hrs based on Position and Division and feeding my master_sheet from the Required sheet:

    =SUMPRODUCT(--(Required!$K$2:$K$6787&Required!$E$2:$E$6787=master_sheet!A3&master_sheet!C3), INDEX(Required!$P$2:$P$6787,, MATCH(master_sheet!$I$2, Required!$O$2:$O$6787,0)))

    Required sheet
    K column: lists position, stored as text
    E column: lists division, stored as text
    P column: Total Hrs in decimals
    O column: Level of expertise
    master sheet
    A column: position
    C column: division
    I2: Expert lookup value

    Here is my issue, the formula worked for the first column on the master sheet but when I tried the same formula on the other columns I get #Ref! error no matter what, I changed the cell from I2 to K2 (lookup value) to look for Intermediate instead of expert and it gives me a #Ref! error. In addition, when I use the same formula with the corresponding cell reference but using the Actual worksheet it also gives me a #Ref! error.
    I do not know what I am doing wrong. Please help!

  18. i have a table with columns of data. Table has the following headers; distance, tee, fairway, rough, sand. In the case of this table the number in the distance column corresponds directly to a number in each of the other columns (and on the same row). I'm looking for a formula that will pull a corresponding number from the "tee", "fairway", "rough", "sand" columns. based on answeres given in a different sheet. I.e 140 (distance) and "Fairway". Im having difficuly figuring out how to get excell to look at or distinguish the correct column to pull from. Thank you for your help!

  19. Hi
    Great work!
    Thank you so much.

  20. Hi,

    I Need help with this scenario.

    I have two sheets Sheet A & Sheet B

    Lets Say

    Sheet A has 4 Columns (Data 1, Data 2, Data3, Data 4)
    Sheet B has 6 Columns (Data 1, Data 2, Data3, Data 4, Data 5, Data 6)

    Data 1 to 4 are same in both sheets

    But the problem here is the order of the data is not same in both the sheets, like if some x data is in Row 1 in Sheet A, it will be in some 100th row in Sheet B.

    How can we match and import the Data 1 to 4 on the sheet A and import the corresponding Data 5 & 6

    1. Hello!
      We have a tool that can solve your task in a couple of clicks - Merge Tables. It is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and check how it works for free.

    2. How can we match the Data 1 to 4 on the sheet A and import the corresponding Data 5 & 6 in to Sheet A from Sheet B?

  21. Can I use and function inside of Vlookup.

  22. Thank you very much for your valuable suggestions. Much appreciated. .. :)

  23. ColA ColB

    Fruits Count
    Apple 10
    Orange 20
    Mango 30
    Apple 20
    Banana 10
    Orange 30
    Apple -30
    Orange -20

    Condition is:
    I need a unique array list of fruits in ColC and do not need the fruits on list whose count is 0. Here, Apple has count 0 as (10+20-30).

    Result may be:

    ColC

    Orange
    Mango
    Banana

    Could you please clarify me below condition. Can we use SUMIF function in Index+Match+Match. I had tried one formula to make output as ColC but did not work. Or, if you can suggest one will be much appreciable.

    {=IFERROR(INDEX(A2:A9,MATCH(0,COUNTIF($C$1:C1,A2:A9)+(SUMIFS(B2:$B$9,A2:$A$9,D2)0),0)),"")}

    Thank you very much in advance.

  24. Thank you very much for your kind and quick response. Much appreciated.

    But, could you please clarify me one condition. Can we use SUMIF function in Index+Match+Match. I had tried one formula but did not work.

    {=IFERROR(INDEX(A2:A9,MATCH(0,COUNTIF($C$1:C1,A2:A9)+(SUMIFS(B2:$B$9,A2:$A$9,D2)0),0)),"")}

    Please clarify on this.

  25. hi,
    I'm sure this is a very simple but I'm struggling in one situation. Need your kind assistance.

    ColA ColB

    Apple 10
    Orange 20
    Mango 30
    Apple 20
    Banana 10
    Orange 30
    Apple -30
    Orange -20

    Condition is:
    I need a unique array list of fruits in ColC and do not need the fruits whose count is 0. Here, Apple has count 0 as (10+20-30).

    Result may be:

    ColC (Sorted) ColC

    Orange Banana
    Mango Mango
    Banana Orange

    In addition, if this list can be sorted in alphabetical order by formula will be great. I'm using Excel 2016.

    Looking forward to your kind reply.

    Thank you very much in advance.

    1. Hello!
      Your version of Excel has very limited options for solving your problem.
      You can use these instructions to get a list of unique values from column A.
      Then, in column D, you can calculate the amount from column B for each unique item. To do this, use the SUMIF function.
      I hope my advice will help you solve your task.

  26. i need an excel formula that will refer back to a chart to look up data and return the correct data. In my spreadsheet, I enter a width in A1, a Depth in B1, a Thickness (from a drop down list) in C1 and then I want the correct cost to populate in D1 based on a table on another worksheet. Can that be done? The table consist of all of the possible dimensions and their costs.

    Please HELP... anyone!

    Thank you sooooo much!

  27. I have a formula with INDEX and MATCH. I use this to get dates from one sheet to another (to keep it brief). In the column in sheet B are several empty cells. These empty cells in sheet B cause the cells in sheet A to be filled with '00-01-1900'. This makes sense, but I would like to fill these with a small text message: "No date". Instead of printing 'no date' it prints '00-01-1900'. How do I solve this?

    My current formula looks like this:
    =IF(sheet B!G2=" ", "No date", INDEX(sheet B!$G$2:$G$4408, MATCH(sheet A!H2,sheet B!$F$2:$F$4408,0)))

    1. Hello!
      I believe the following formula will help you solve your task:

      =IF(B!G2="", "No date", INDEX(B!$G$2:$G$4408, MATCH(A!H2,B!$F$2:$F$4408,0)))

      I hope it’ll be helpful.

      1. Hey,

        Thank you for your quick reply. It doesn't change anything. But I am using a Dutch version of Excel: therefore I translated my formula to English. The formula I have before me is this: =ALS(Inspecties!G2=" "; "Geen inspectiedatum"; INDEX(Inspecties!$G$2:$G4408; VERGELIJKEN(Hoofdbestand!H2;Inspecties!$F$2:$F$4408;0)))

        I tried to replicate your adjusted formula, but I get the same result. Can you look at my formula again? If you need more information, just say the word.

        Thanks,
        Patrick

          1. Hey,

            Sadly, I get the same outcome :(.
            Can you think of anything else?

            Thanks,
            Patrick

            1. Hello!
              Unfortunately, without seeing your data it is impossible to give you advice.
              Could you please describe your task in more detail and send us a small sample workbook with the source data and expected result to support@ablebits.com? Please shorten your tables to 10-20 rows/columns and include the link to your blog comment.

  28. Milestones in Column E of input-contract sheet as, "Effective date", "Payment 1", "Export License", "Kick-off meeting", etc.
    Trigger event in Column C of input-contract sheet as, "Contract Registration", "Effective date", "payment 1", "export License", etc.
    Milestone date in column E of input-contract sheet (which is calculated based on conditions) as, "1-Jan-21", "1-Jan-21", "22-Jan-21", "5-Feb-21", etc.

    I want to build a financial model in another sheet (model sheet), for that I used the transpose function entered as an array formula to transpose the values of column E in a row into the model sheet. it worked well.

    now, I wanted to bring in the milestone dates associated with those milestones and wanted to use the INDEX MATCH function. This is what I typed in the model sheet =INDEX('Input-contract'!E22:E52,MATCH(Model!B20,'Input-contract'!A22:A52),0). where Model!B20 is "Effective date"

    I wanted the formula to look for the date when the "effective date" took place which should have been 1-Jan-21. However, the formula returns me the value of 19-Nov-23.

    all cells are formated appropriately, not sure why this happening. can you help?

    Thanks,

    Luis

    1. Hello!
      Unfortunately, without seeing your data it is impossible to give you advice.

      I'm sorry, it is not very clear what result you want to get. Could you please describe your task in more detail and send us a small sample workbook with the source data and expected result to support@ablebits.com? Please shorten your tables to 10-20 rows/columns and include the link to your blog comment.

      We'll look into your task and try to help.

  29. =INDEX(Column_1,MATCH(1,MMULT(--(Draw_Data=Your_Selection),0)))

    Draw_Data => rows of 7 unique numbers
    Your_Selection => 7 unique numbers chosen

    In the calculation steps produces a series of 7 "TRUE"s ... in it's output (and many "FALSE" also). How could I obtain a result of "Yes" to the function based on the 7 "TRUE"s or "NO" if there are not 7 "TRUE"s in a row?

    Thank you for your time and efforts,
    Myron

    1. Hello!
      Your task is not completely clear to me. Unfortunately, without seeing your data it is difficult to give you any advice. Please provide me with an example of the source data and the expected result.
      Could you please describe your task in more detail and send us a small sample workbook with the source data and expected result to support@ablebits.com? Please shorten your tables to 10-20 rows/columns and include the link to your blog comment.

      We'll look into your task and try to help.

  30. This is a question in a similar vein. A spreadsheet containing a column of random text, and each line of this text contains a "Unit Number" somewhere in the text. I tried to write LEFT, MID, RIGHT rules to extract these "unit numbers" onto a seperate column, but the positions in the text are even too random for that.

    So I would like to take a different approach. (1) Have a complete list of the "Unit Numbers" on a seperate sheet. (the complete fleet) and (2) then reference this list against the random text. If it finds a match to the UN list anywhere in the random text, it deposits that Unit Number that it found on the UN list onto the find formula column.
    Any suggestions for a MATCH or VLOOKUP or some other formula that would do that?

    1. Hello!
      Unfortunately, without seeing your data it is difficult to give you any advice. Please provide me with an example of the source data and the expected result.

  31. I HAVE THE MANY AMOUNTS IN ONE ROW FROM 100 TO 1500 AND I WANT TO MAKE THE MATCH/GROUP/BATCH OF 2500 HOW CAN I DO IT IN EXCEL PLS REPLY

    1. Hi,
      I’m sorry but your task is not entirely clear to me. For me to be able to help you better, please describe your task in more detail. Please specify what you were trying to find. Give an example of the source data and the expected result.
      It’ll help me understand it better and find a solution for you.

  32. Hi, I am trying to fetch a value using formula but unable to do so as it is returning me #REF
    Formula i used is as below.
    =INDEX(Priority!A5:G16,MATCH(A16,Priority!A:A,0),MATCH(B15,Priority!B4:G4,0))

    Could you please help !!

    1. Hello!
      The #REF error means that your INDEX function wants to show a value that isn't there. For example, in the range A5:G16 there are 12 lines. You want to show the value from the 14th line.
      I hope my advice will help you solve your task.

      1. This is what my sheet is
        P1 P2 P3 P4
        March 4 2 7 9
        December 5 1 8 6

        1. Hello!
          Sorry, it's not quite clear what you are trying to achieve. What cells are your data recorded in? A21:E23? No! Do you want to get several values with one formula? Describe the expected result more clearly. What is written in A17 and B16?

        2. This is what my Sheet is
          P1 P2 P3 P4
          March 4 2 7 9
          December 5 1 8 6

          and this is what i am trying to find
          P3
          March 2

          using formula "=INDEX(A21:E23,MATCH(A17,A21:A23,0),MATCH(B16,B21:E21,0))"

          But it is returning me value of P2 instead of P3. Can you please help why it is returning value of a column before.

  33. Hi,
    Hi, I'm trying to create a formula that allows me to search a column for a product number which exactly matches the product number (in a column) in another workbook. The first workbook has a product cost associated with it, in a separate column. The second workbook has a price associated also (which is a price change in a separate column).
    I would like to populate a new column in Workbook 1 with the new price. (price increase)
    Workbook 1 has hundreds of items and cost prices.
    Workbook 2 (only select items from original list in Workbook 1) Price Increases
    The item numbers are not on the same line in the two workbooks.
    I need to match the item numbers from the two workbooks and bring the price increase associated with the product item number (from Workbook 2) into the original workbook. (Workbook 1)

  34. Hi - I tried to use INDEX and MATCH together and have been getting a #VALUE! error. I tried to break it down, and created a cell with just the MATCH part in it. But no luck.

    So I put the cells with identical (perfectly identical) long strings of text in them. I know they are identical because I pasted from one cell to the other. Next to these cells I created a cell with a simple IF condition to return YES if the cells with the text are equal. Indeed, it returned "YES" So I then created a MATCH formua in the next cell which reads something like: =MATCH(K850,J800:J900,0). The identical cells are in J850 and K850 respectively. Yet - no luck at all.

    The text btw is "Care Instructions: Lid Cork, Use only for its intended purposes. Immediately wash and dry well after use, and keep dry when not in use. Do not overheat in the microwave or heat without water. Wash with care. Don't use abrasive cleansers or steel wool. Don't place near fire. Sudden temperature changes may break or shatter the product. While the glass is hot, don't pour cold liquids into it and don't place it to on a wet cloth or in a wet sink. Be aware that the lid may become stained with the odor or color of some foodstuffs.". Nothing personal or confidential so I decided to paste it here.

    What am I doing wrong?

    1. Hello!
      Unfortunately, without seeing your data it is difficult to give you any advice. Could you please describe your task in more detail and send us a small sample workbook with the source data and expected result to support@ablebits.com? Please shorten your tables to 10-20 rows/columns and include the link to your blog comment.

      We'll look into your task and try to help.

  35. When I put in this formula I get the N/A
    result, =INDEX(MIN(IF(F2:F77>0,F2:F77)),MATCH(1,INDEX((L22=A2:A77)*(M22=B2:B77),0,1),0))
    Column F is the result of another formula, What should I change to make this formula work.

    1. Hello!
      INDEX MATCH formula in Excel cannot find a lookup value. This N/A error is explained in this article above. Unfortunately, without seeing your data it is difficult to give you any advice.

  36. Thank you for this, I have used it so often and it has saved me SO MUCH time. Just one thought, there has been a change in how Excel handles the function and you now need to add "@" before "lookup value" to prevent a SPILL error. Perhaps you can update the formula?

  37. Hello excel Guru's, I am hoping someone may be able to asst me with creating a formular for the below? It's beyond my basic excel capabilities.

    Column A contains task numbers (i.e SMT001) and column P contains a task duration in seconds(i.e 11040). I need a formula that can search column A for duplicate task numbers and add the corresponding task durations in column P to give me a total task duration. is this even possible in excel?

    Any guidance would be appreciated.

  38. Hi, i'm trying to create a formula that allows me to search a column for a reference number which exactly matches the reference number on another worksheet within the same workbook. I need it to return a Yes or No.
    On worksheet 2 In cell H3, I would like it to return a Yes if the ref number in Cell E3 matches any of the ref numbers on Worksheet 1 Column E Range E2:E500.

    1. Hello Lisa!
      If I understand your task correctly, the following formula should work for you:

      =IF(ISNUMBER(MATCH(E3,Sheet1!E2:E500,0)),"Yes","No")

      I hope my advice will help you solve your task.

  39. Thank you so much Alexander! I really appreciate your help.
    When I tried your formula, the cell defaults to Y, even if B16:B46 are blank. But as soon as an N is put in any of the cells, the cell will turn to N. So anything but an N will keep the cell as Y. I was trying to have it such that even a blank cell in B16:B46 would result in the cell having an N. This will work for now, though. Thank you again! I very much appreciate it!

  40. How do I write the following formula:
    If B16:B46 are all Y, then this cell should be Y. If any of the cells between B16:B46 are N, then this cell should be N.
    Also, how do I write this formula with two factors:
    If B16:B46 AND C16:C46 are all Y, then this cell will be Y. If any of those cells have an N, then this cell should be N.

    1. Hello Mohammed!
      If I understand your task correctly, the following formula should work for you:

      =IF(ISNUMBER(MATCH("N",B16:B46,0)),"N",IF(IFERROR(MATCH(1,IF(B16:B46="Y",0,1),0),"Y")="Y","Y",""))

      I hope this will help

  41. I have a result set as below:
    COL A COL B
    1111987 1224
    1119361 1072
    1119361 1223
    1119361 1224
    1123961 1223
    1123961 1224
    1124136 1072
    1124136 1223

    Since No# - 1124136, isn't having a combo of 1224, I wish to have that as a result.
    Please assist.

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =INDEX(A1:A8,MATCH(0,COUNTIFS(A1:A8,"="&A1:A8,B1:B8,"=1224"),0))

      I hope this will help

  42. I have name of students in column B and grade scored in column BT in sheet 1. I want to pull the name of students who scored A to sheet 2, B to sheet 3, C to sheet 4 etc

  43. I am looking to match based on two unique numbers that have the same result. The lookup tables or array results are in a different
    Example.

    Column A = US product ID #
    Column B = CA product ID #
    Column C = the product name of both Column A and Column B of that Same row, so can have either a corresponding US or CA Product ID

    Example: US1234 or CA123 = pencils

    For the entry, they will only enter in product ID number below, and I want to dynamically return the product name without knowing if it will be a US ID or a CA iD
    Product ID Product Name

    Thanks

    1. Hello Joseph!
      If I understand your task correctly, the following formula should work for you:

      =IFERROR(INDEX(C1:C5,MAX(IFERROR(MATCH("*"&$E$1&"*",A1:A5,0),-1), IFERROR(MATCH("*"&$E$1&"*",B1:B5,0),-1))),"ERROR")

      where E1 -- Product ID

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  44. Hi all,Good day
    I need some help.
    I have a list of 5000 items.
    For each item, many Purchase orders have been raised.
    how to extract item wise Purchase order numbers. Tried VLOOKUP and pivot , not able to get.

    1. Hello ANAND!
      I’m sorry but your task is not entirely clear to me.
      What is " item wise Purchase order numbers"? What exactly do you want to count? How many purchase orders were there? Amount?
      For me to be able to help you better, please describe your task in more detail. It’ll help me understand it better and find a solution for you. Thank you.

  45. I am using the formula to copy values from one sheet to other, from a table with 8 columns. The value has to come from the 8th column. The formula is working fine. Kindly inform if any variable can be put instead of writing 8.
    Thanks.
    Sheets("EXE_1").Select
    Range("O4").Select
    ActiveCell.FormulaR1C1 = _
    "=IFERROR((INDEX(MIN_WIP!R4C17:R20C25, MATCH(EXE_1!RC[-13],MIN_WIP!R4C17:R20C17,0),8)),""0"")"

    1. Hello Manas!
      It is possible to insert an expression, which will return a number, instead of "8" in your formula. However, to give you a full and accurate answer, additional information on the result you would like to get is required. Moreover, I would like to see your formula in standard view, not R1C1.

  46. Hello,
    I have a table of values where I want to pick a specific unit, look for the last (previous) "on" for that unit, and record/calculate the time in between when the unit was turned on and when it was turned off.

    I.E. - Lights - Jerry turned the lights ON @ 11/1/2019 10:56AM and OFF @ 11:05AM so the DURATION = 00:09:00.

    Person TIME ON/OFF UNIT DURATION
    Dan 11/1/2019 10:00AM OFF Lamp
    Jerry 11/1/2019 10:56AM ON Lights
    Tom 11/1/2019 10:59AM ON Door
    Dan 11/1/2019 11:02AM ON Car
    Dan 11/1/2019 11:03AM OFF Car 00:01:00
    Jerry 11/1/2019 11:05AM OFF Lights 00:09:00

    How do I get the DURATION cell in the "Lights" "OFF" line to populate based off the TIME from the last "Lights" "ON" line?

    Thank you!

  47. Hi,
    I try to lookup formula match with any of two different range. It means first look with A4 suppose if details not available means get the data with B4 cell.

  48. It seems a Windows update has now broken this formula and it produces a #SPILL error message. Can you produce a workaround for this?

    1. Hi Graham,

      I've retested the formulas in our sample worksheet. All seem to be working normally. Can you please specify exactly which one returns an error?

  49. NEW STOCK
    TOTAL
    32

    OLD STOCK
    TOTAL
    45

    OLD 0-100 DAYS
    40
    OLD 100+ DAYS
    5
    NEW 0-100 DAYS
    RESULT REQUIRED
    32
    NEW 100+ DAYS
    0

  50. Hi, if there a “name “in a2,a6,a7,a16 etc how can I fetch data of b2,b6,b7 and so on? I tried using index but it ends up with showing result of b2 only

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