+ Reply to Thread
Results 1 to 11 of 11

INDEX MATCH with multiple criteria

  1. #1
    Registered User
    Join Date
    10-25-2017
    Location
    United States
    MS-Off Ver
    2019
    Posts
    63

    INDEX MATCH with multiple criteria

    i have a workbook that has employee names, spouses and children. I am attempting to make a list of employees based on the relationship column and the package column. The list would encompass every employee that has the relationship "1" and a MEDICAL package. When I write a INDEX MATCH formula, it only retrieves the the first employee and not any of the other employees.

    Relationship meaning:
    1 = Employee
    2 = Spouse
    3 = Children

    The next question is some employees have multiple children that is signified with a 3. The 3 is not unique making it hard to write a formula to retrieve the children's birthday. How can I make the 3 unique for families that have multiple children?

    I have attached the sample workbook along with my desired result.

    Thank you for helping!
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: INDEX MATCH with multiple criteria

    Here's the first formula:

    =IFERROR(INDEX($A$1:$A$500,AGGREGATE(15,6,ROW($2:$500)/(($D$2:$D$500=1)*($E$2:$E$500="MEDICAL")),ROW(1:1))),"")

    However, the rest becomes tricky, because there is nothing in the source data linking a spouse or offspring to the main person other than they follow them in the source table. I can't believe that the real data is that well-organised, especially if there's been a new baby: their record might be a lot further down the list. So, you need a family identifier column to link family members.

    You could use the employee ID number.
    Last edited by AliGW; 07-20-2018 at 12:58 PM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: INDEX MATCH with multiple criteria

    Try these:

    G3 in post #2

    H3 =IFERROR(INDEX(C:C,MATCH(G3,A:A,0)),"")

    I3 =IFERROR(INDEX(C$2:C$19,INDEX(MATCH("*"&MID(G3,FIND(" ",G3),LEN(G3))&2,A$2:A$19&D$2:D$19,0),0)),"")

    J3 =IFERROR(INDEX($C:$C,SMALL(IF(ISNUMBER(SEARCH(MID($G3,FIND(" ",$G3),LEN($G3)),$A$2:$A$19))*($D$2:$D$19=3)*($E$2:$E$19="MEDICAL"),ROW($A$2:$A$19)),COLUMNS($A:A))),"") Ctrl Shift Enter

    Drag J3 over through K3 then drag all of the formulas down as far as needed.

  4. #4
    Registered User
    Join Date
    10-25-2017
    Location
    United States
    MS-Off Ver
    2019
    Posts
    63

    Re: INDEX MATCH with multiple criteria

    There is a column in the data I deleted because I didnt think it was helpful so that is my mistake, but it links all the family members by the employees name. I would still run into the issue of multiple children since the 3 is not unique. Once I had the employee list, I was thinking of just doing a simple vlookup to populate the remaining fields.
    Attached Files Attached Files

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: INDEX MATCH with multiple criteria

    Did you try the suggestion in post #3? It returns the desired output listed in the sample from post #1.

    It goes off of last name.

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: INDEX MATCH with multiple criteria

    Using the workbook from post #4, you can use these:

    J3 =IFERROR(INDEX(D$2:D$19,INDEX(MATCH(H3&2,A$2:A$19&E$2:E$19,0),0)),"")

    K3 =IFERROR(INDEX($D:$D,SMALL(IF(($A$2:$A$19=$H3)*($E$2:$E$19=3)*($F$2:$F$19="MEDICAL"),ROW($A$2:$A$19)),COLUMNS($A:A))),"") Ctrl Shift Enter

  7. #7
    Registered User
    Join Date
    10-25-2017
    Location
    United States
    MS-Off Ver
    2019
    Posts
    63

    Re: INDEX MATCH with multiple criteria

    These formulas work perfectly, thank you! Sending Rep!

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: INDEX MATCH with multiple criteria

    Happy to help. Thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: INDEX MATCH with multiple criteria

    Hello again, you had sent me the following PM:
    how would you rewrite the formula for the children DOB's without the MEDICAL part of the formula? I updated my spreadsheet to generate a list of employees with relationship 1 only instead of relationship 1 & MEDICAL. Not every employee will have a medical package in column F.

    Please Login or Register  to view this content.
    thank you and appreciate your help!
    I do not work privately so we can continue here.

    Have you tried removing the *($F$2:$F$19="MEDICAL") part of the formula? If that doesn't work as expected, consider sharing a small representative sample of your data along with the desired output.

  10. #10
    Registered User
    Join Date
    10-25-2017
    Location
    United States
    MS-Off Ver
    2019
    Posts
    63

    Re: INDEX MATCH with multiple criteria

    When I remove the *($F$2:$F$19="MEDICAL") part of the formula, Children date of births are duplicated due to some having both MEDICAL & DENTAL packages. I have attached my workbook with desired results and a table showing what the formula is doing.
    Attached Files Attached Files

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: INDEX MATCH with multiple criteria

    This can be solved easily with a helper column - any good?

    In G2 copied down:

    =COUNTIFS($C$2:C2,C2,$D$2:D2,D2)

    This column can be hidden.

    Then, your formula will be:

    =IFERROR(INDEX($D:$D,SMALL(IF(($A$2:$A$34=$H12)*($E$2:$E$34=3)*($G$2:$G$34=1),ROW($A$2:$A$34)),COLUMNS($A:A))),"")
    Last edited by AliGW; 08-08-2018 at 11:06 AM.

+ 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. [SOLVED] Index Match with multiple criteria and date criteria
    By snolem75 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2018, 03:51 PM
  2. Replies: 16
    Last Post: 01-05-2018, 11:04 PM
  3. Need help in Index, Match usage to match multiple criteria in sum function
    By Summer0830 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2017, 02:47 AM
  4. 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
  5. [SOLVED] INDEX/MATCH with Multiple MATCH criteria ?
    By KomicJ in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-17-2015, 09:04 AM
  6. [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
  7. Replies: 2
    Last Post: 09-27-2014, 04:34 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