+ Reply to Thread
Results 1 to 12 of 12

Index Match with 2 or more criteria

  1. #1
    Registered User
    Join Date
    12-08-2013
    Location
    Michigan, America
    MS-Off Ver
    Excel 365
    Posts
    21

    Index Match with 2 or more criteria

    Hello,

    I know this question has been asked a lot but all of the answers I am finding contains a formula that looks something like this --> =INDEX($D$2:$D$9,MATCH($B$11&B$14,$B$2:$B$9&$G$2:$G$9,0))

    However, what I am trying to accomplish is to pull data from one spreadsheet that meets criteria in two different columns and then coping the formula on my other spreadsheet in multiple areas (highlighted in yellow). I know this isn't the best explanation so I attached a spreadsheet.

    Thanks for any advice.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-17-2012
    Location
    Canada
    MS-Off Ver
    Excel 365
    Posts
    221

    Re: Index Match with 2 or more criteria

    Hi Philip

    i had to tweak one of the columns but this should help. You needed to add another match function for looking up the column.
    Attached Files Attached Files

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2411
    Posts
    13,587

    Re: Index Match with 2 or more criteria

    I, too, took some liberties with the layout. Offset row headers pose the same problems as merged cells. They cause havoc with formulas.

    To expedite matters the source needs to be laid out as a flat data base. Have a contiguous column of Practice 'codes'. This allows for unique pairings.

    I did the same in the output section.

    The formula I used in C3 is array-entered, then filled down and across to G27.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter. Curly braces {} around the formula in the formula bar confirm correct entry.
    Attached Files Attached Files
    Dave

  4. #4
    Registered User
    Join Date
    12-08-2013
    Location
    Michigan, America
    MS-Off Ver
    Excel 365
    Posts
    21

    Re: Index Match with 2 or more criteria

    Thank you both for your solutions! What I am gathering from both of your answers is that you have to have flat data in order to get the formula's to work. Is there another formula that can generate the answer without flat data and without changing the format?

    The reason I ask is because the spreadsheet that I am trying to get the data from is huge and by copying Practice 1, Practice 2, etc next to each BCBC, Commercial, etc will take awhile.

    This gives me a lot to think about.
    Thanks

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2411
    Posts
    13,587

    Re: Index Match with 2 or more criteria

    Rather than copy / paste you might try inserting a temporary helper column adjacent to the original.


    Then use something like this to fill in the blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    When you are finished copy whole range of results and paste Values back onto itself. Then delete the original column.

    Before you delete the original column it would resemble this:



    Row\Col
    A
    B
    1
    Practice 1 Practice 1
    2
    Practice 1
    3
    Practice 1
    4
    Practice 1
    5
    Practice 1
    6
    Practice 2 Practice 2
    7
    Practice 2
    8
    Practice 3 Practice 3
    9
    Practice 3
    10
    Practice 3
    11
    Practice 3
    12
    Practice 3
    13
    Practice 3
    14
    Practice 3
    15
    Practice 4 Practice 4
    16
    Practice 4
    17
    Practice 4
    18
    Practice 4
    19
    Practice 4
    20
    Practice 4
    21
    Practice 4

  6. #6
    Registered User
    Join Date
    12-08-2013
    Location
    Michigan, America
    MS-Off Ver
    Excel 365
    Posts
    21

    Re: Index Match with 2 or more criteria

    That's a neat trick. So I can understand what is happening, are the "zzzz" like a placeholder in Excel?

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2411
    Posts
    13,587

    Re: Index Match with 2 or more criteria

    No it 'instructs' LOOKUP to find the last string less than or equal to a sufficiently larger than likely string ... zzzzz .... in this case. This assures that LOOKUP will always return the last item in the reference range.

    It can be used for numbers as well with a sufficiently large number in the first argument.

    I often use is for helper columns when merged cells are present.

  8. #8
    Registered User
    Join Date
    12-08-2013
    Location
    Michigan, America
    MS-Off Ver
    Excel 365
    Posts
    21

    Re: Index Match with 2 or more criteria

    I am going to try this along with your formula tomorrow and see if this will solve my problem.
    Thanks,

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2411
    Posts
    13,587

    Re: Index Match with 2 or more criteria

    You're welcome. Thanks for the feedback. Let us know how it turns out.

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,218

    Re: Index Match with 2 or more criteria

    I've also changed column I in your file (coloured blue), and then put this array* formula in C3:

    =IFERROR(INDEX($K$2:$O$27,MATCH(LOOKUP("zzz",$A$1:$A3)&$B3,$I$1:$I$18&$J$2:$J$18,0),COLUMNS($C:C)),"")

    This can be copied across to G3, and then down to your other yellow cells, as can be seen in the attached file.

    *Note: an array formula needs to be committed using the key combination of Ctrl-Shift-Enter (CSE), rather than the usual < Enter >.

    Hope this helps.

    Pete
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    12-08-2013
    Location
    Michigan, America
    MS-Off Ver
    Excel 365
    Posts
    21

    Re: Index Match with 2 or more criteria

    Thanks everyone for your input. I was able to improve the spreadsheet I was working on exponentially!

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2411
    Posts
    13,587

    Re: Index Match with 2 or more criteria

    Glad to hear it. Thanks for letting us know.

+ 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] Combining 3 Formulas: Return all Names that Match Criteria Using Index/Match
    By bchilme in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-29-2014, 09:28 AM
  3. Replies: 2
    Last Post: 09-27-2014, 04:34 PM
  4. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  5. Index Match using two criteria to return on of criteria values
    By RogueLeader in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2014, 09:50 AM
  6. Index and Match with Two Criteria, and date Match Type is Less Than
    By ExcelQuestion in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-11-2013, 08:57 AM
  7. Index Match based on 2 Criteria only returning 1 match
    By stsanders22 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2012, 11:26 PM

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