+ Reply to Thread
Results 1 to 13 of 13

Index match with multiple criteria

  1. #1
    Registered User
    Join Date
    02-21-2021
    Location
    Manila
    MS-Off Ver
    O365 16:61
    Posts
    54

    Index match with multiple criteria

    Hi All

    I have been trying to figure how to make Index Match work in a case that has multiple columns. I have also searched the forum for "index small" and "index aggregate" hoping to find a solution that fits my problem but found nothing.

    I have created the following Index Match Match formula that returns a single value. How can I adapt the formula to extract additional hlookup values (that I would be able to copy down)?

    =INDEX(B3:G6, MATCH($I$3, $A$3:$A$6, 0), MATCH("Box", B2:G2, 0))

    Appreciate the Help. Cheers.
    Attached Files Attached Files

  2. #2
    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,926

    Re: Index match with multiple criteria

    Im not sure what your expected outcome would look like - can you explain?
    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

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Index match with multiple criteria

    In J3, copied down??

    =IFERROR(INDEX(INDEX($B$3:$G$6,MATCH($I$3,$A$3:$A$6,0),),AGGREGATE(15,6,COLUMN($B$2:$G$2)-COLUMN($B$2)+1/($B$2:$G$2<>"Cost"),ROWS(J$3:J3))),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    02-21-2021
    Location
    Manila
    MS-Off Ver
    O365 16:61
    Posts
    54

    Re: Index match with multiple criteria

    Thank you both for the incredibly fast responses. I see both of your answers a lot whenever I search for something in the forum and have been able to apply several to the workbook I am currently working on. As for the formula, it would not work at first, until I tested it on the same worksheet as the source data. I should have said that I expected to see the output in a separate worksheet. Apologies. How can it be modified to do that?

    Glenn, thank you so much for the assistance. This is the second time since I joined a few weeks back.
    Last edited by aswethink; 03-13-2021 at 04:44 AM.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Index match with multiple criteria

    What is the name of the worksheet that the data is being TAKEN FROM?

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Index match with multiple criteria

    Don't worry about it. I have to go out now.


    see modified file. I'll be back in 1-2 hrs if you still have issues. but for now....


    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

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

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Index match with multiple criteria

    Duhhh! Now with modified file...
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    02-21-2021
    Location
    Manila
    MS-Off Ver
    O365 16:61
    Posts
    54

    Re: Index match with multiple criteria

    Hi Glenn,

    I thought a certain function in the formula didn't work across multiple sheets and therefore asked for a tweak.

    Upon seeing that it's the same formula (but with sheet references - thank you ), I realised I was doing something wrong.

    Found on closer inspection that I was including the column headers in the data_array portion. That's why I was getting the wrong values.

    Works perfectly now. Thank you!

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Index match with multiple criteria

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

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

  10. #10
    Registered User
    Join Date
    02-21-2021
    Location
    Manila
    MS-Off Ver
    O365 16:61
    Posts
    54

    Re: Index match with multiple criteria

    Glenn, I have one more question in connection to the formula. I realised it might be better to display the results in helper columns on the same sheet as the data. What should I change in case I were to drag the results across?
    Last edited by aswethink; 03-13-2021 at 06:29 PM.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Index match with multiple criteria

    Try this:

    =IFERROR(INDEX(INDEX($B$3:$G$6,MATCH($I$3,$A$3:$A$6,0),),AGGREGATE(15,6,COLUMN($B$2:$G$2)-COLUMN($B$2)+1/($B$2:$G$2<>"Cost"),COLUMNS($J3:J3))),"")

    change the bit in red to wherever the formula is.

    However, if you change your mind, or it doesn't work as desired... post a sample sheet showing what you want, where you want it... as this is turning into a guessing game, held in the dark!!

  12. #12
    Registered User
    Join Date
    02-21-2021
    Location
    Manila
    MS-Off Ver
    O365 16:61
    Posts
    54

    Re: Index match with multiple criteria

    Glenn! Thank you!

    I am learning things as I go. I started a workbook last month that I didn't realise was going to get so complex. Before that time, I only knew how to do basic sum, product functions, not knowing what vba was nor index match. So there are times when it's difficult to even describe what I need, let alone succinctly, on the title of a thread.

    But I'll make sure to be clearer in future posts. Anyway, the formula works great. As was the description - a guessing game in the dark - poetic .

    To sum up for others who come across the thread. I wanted a formula that would retrieve several cells associated with a certain match entry.

    Glenn gave two formulas that did such. One that can be dragged down into rows and another that can be copied across columns.

    =IFERROR(INDEX(INDEX($B$3:$G$6,MATCH($I$3,$A$3:$A$6,0),),AGGREGATE(15,6,COLUMN($B$2:$G$2)-COLUMN($B$2)+1/($B$2:$G$2<>"Cost"),ROWS(J$3:J3))),"")

    =IFERROR(INDEX(INDEX($B$3:$G$6,MATCH($I$3,$A$3:$A$6,0),),AGGREGATE(15,6,COLUMN($B$2:$G$2)-COLUMN($B$2)+1/($B$2:$G$2<>"Cost"),COLUMNS($J3:J3))),"")
    Last edited by aswethink; 03-14-2021 at 05:29 AM.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Index match with multiple criteria

    Hahaha. you're welcome!!

+ 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. VBA function to match multiple criteria faster than vlookup or index match
    By bkav1991 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-09-2020, 09:14 AM
  2. Replies: 1
    Last Post: 03-25-2020, 08:06 AM
  3. Replies: 1
    Last Post: 03-01-2020, 10:36 PM
  4. INDEX MATCH from table with multiple MATCH criteria
    By nostrum in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-30-2019, 11:41 AM
  5. Replies: 16
    Last Post: 01-05-2018, 11:04 PM
  6. 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
  7. Replies: 2
    Last Post: 09-27-2014, 04:34 PM

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