+ Reply to Thread
Results 1 to 15 of 15

Index Match with Multiple Criteria - Problems

  1. #1
    Registered User
    Join Date
    10-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Index Match with Multiple Criteria - Problems

    Hi there,

    I'm stuck and need some help with getting an Index/Match formula to work.

    I have attached my file in case anyone is able to help me out. This shows a snippet of my data. I need to calculate the time target to set based on 2 criteria in cells A3 and B3. The lookup table is in cells A5:C77. For the Amount Criteria (B3) I expect Excel to find the largest value that is less than or equal to the lookup value.

    My attempt at an Index Match formula is in C3 - this unfortunately is not showing the desired results. I am obviously making an error in this formula but unfortunately I haven't been able to figure out where I am going wrong.

    Hopefully someone can help.

    Regards
    Almugs
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Index Match with Multiple Criteria - Problems

    It is strange about your file. when I download it the red cell is showing your desired result i.e 77 but when I press F2 to get into edit mode then press enter it shows Value error.

  3. #3
    Registered User
    Join Date
    10-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Index Match with Multiple Criteria - Problems

    Hi,

    Thanks for looking. Unfortunately the formula only shows the correct result occasionally. When you go into Edit Mode I believe you lose the curly brackets as the formula was entered as an array formula with CSE. Hence why you see the Value error.

    Regards,
    Almugs

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,472

    Re: Index Match with Multiple Criteria - Problems

    Hope it helps:

    =LOOKUP(2,1/(($A$6:$A$9=$A$3)*($B$6:$B$9<=$B$3)),$C$6:$C$9)
    Quang PT

  5. #5
    Registered User
    Join Date
    10-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Index Match with Multiple Criteria - Problems

    The formula I am using is =INDEX($A$6:$C$9,MATCH(1,(A3=$A$6:$A$9)*(B3=$B$6:$B$9)),3) entered as an array formula

  6. #6
    Registered User
    Join Date
    10-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Index Match with Multiple Criteria - Problems

    Thanks very much. Works like a charm. It looks like Index Match wasn't the right way to go for this

  7. #7
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,296

    Re: Index Match with Multiple Criteria - Problems

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    10-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Index Match with Multiple Criteria - Problems

    Very impressive formulas both. Trying to understand how they both work
    Czeslaw. I got the first formula to work after editing the semi colon to a comma. =max(index(c6:c9*($a$6:$a$9=$a$3)*($b$6:$b$9<=$b$3),0)). However, I couldn't get the second formula working

    I am not sure which is the right formula to use - if only I could use both

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Index Match with Multiple Criteria - Problems

    Quote Originally Posted by almugs View Post
    Thanks very much. Works like a charm. It looks like Index Match wasn't the right way to go for this
    No, INDEX/MATCH can do this fairly easily. 2 ways...
    NON-ARRAY...
    =INDEX($C$6:$C$9,MATCH($A$3&$B$3,INDEX($A$6:$A$9&$B$6:$B$9,0)))
    ARRAY method...
    =INDEX($C$6:$C$9,MATCH($A$3&$B$3,$A$6:$A$9&$B$6:$B$9))
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    When you go into Edit Mode I believe you lose the curly brackets as the formula was entered as an array formula with CSE. Hence why you see the Value error.
    Correct, you MUST enter array formulas using CTRL SHIFT ENTER
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Registered User
    Join Date
    10-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Index Match with Multiple Criteria - Problems

    Hi Ford,

    Thanks. I am trying to understand how this Index/Match formula works as its obviously a bit different from the format I was using. Yours uses & quite a lot?

    I tried the non array formula and it didn't work as intended until I added a match type 1 as below:
    =INDEX($C$6:$C$9,MATCH($A$3&$B$3,INDEX($A$6:$A$9&$B$6:$B$9,0),1))
    Is this the correct way of doing it?

    Thanks again
    Al

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Index Match with Multiple Criteria - Problems

    I left out the ,1 but you could add if it you want. I left it out and got what I show below...
    A
    B
    C
    D
    E
    2
    Location Amount Time Target
    3
    Europe
    7500
    77
    77
    77
    4
    5
    Location Amount Time Target
    6
    Europe
    0
    42
    7
    Europe
    3,500.00
    56
    8
    Europe
    10,000.00
    63
    9
    Europe
    20,000.00
    77

    C3=INDEX($A$6:$C$9,MATCH(1,(A3=$A$6:$A$9)*(B3=$B$6:$B$9)),3)
    ARRAY entered
    D3=INDEX($C$6:$C$9,MATCH($A$3&$B$3,INDEX($A$6:$A$9&$B$6:$B$9,0),1))
    E3=INDEX($C$6:$C$9,MATCH($A$3&$B$3,INDEX($A$6:$A$9&$B$6:$B$9,0)))

    Interesting that yours did not work that way, what was your actual criteria, and what was in the search range?

  12. #12
    Registered User
    Join Date
    10-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Index Match with Multiple Criteria - Problems

    Hi Ford,

    The criteria in your table above should bring back a Time Target of 56 not 77. That's the issue I was encountering.

    Regards
    Al

  13. #13
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Index Match with Multiple Criteria - Problems

    C3=lookup(2,1/(($A$6:$A$9=$A3)*($B$6:$B$9<=$B3)),$C$6:$C$9)
    Try this
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Index Match with Multiple Criteria - Problems

    Quote Originally Posted by almugs View Post
    Hi Ford,

    The criteria in your table above should bring back a Time Target of 56 not 77. That's the issue I was encountering.

    Regards
    Al
    I must have been asleep

    Try this ARRAY formula...
    =INDEX($C$6:$C$9,MATCH(IF($A$6:$A$9=$A$3,$B$3,0),$B$6:$B$9),1)

  15. #15
    Registered User
    Join Date
    10-10-2009
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    52

    Re: Index Match with Multiple Criteria - Problems

    Thanks everyone for the multiple solutions. This has been very helpful.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Index/Match to Match entries on multiple criteria
    By manning457 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2015, 02:32 PM
  2. [SOLVED] Index Match with Multiple Criteria Using Same Criteria Column
    By rominjn in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-05-2015, 11:34 AM
  3. Replies: 2
    Last Post: 09-27-2014, 04:34 PM
  4. [SOLVED] Index Match using multiple criteria to match to
    By sacastiglia in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-25-2014, 03:46 PM
  5. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  6. Problems with reference to multiple arrays using VLOOKUP / INDEX-MATCH
    By tnuis in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2013, 07:21 AM
  7. Replies: 10
    Last Post: 12-18-2012, 07:59 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1