+ Reply to Thread
Results 1 to 11 of 11

Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

  1. #1
    Registered User
    Join Date
    06-24-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    88

    Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    Hello

    I have a Register workbook (Please see attached sample file) showing cheques given to various people. In the same workbook, I have a "Summary" sheet where it shows me the snapshot of the database.

    In the Summary sheet, I have a dynamic list showing "Cheques Due This Week" under which I am currently picking the relevant rows from the Register based on current Week Number.

    In the Register worksheet, in column M, I have Cheque status i.e. Active or non-Active.

    1) I am trying figure out a way to display records that meet both the criteria i.e. Current Week Number and "Active" status in column M of worksheet "Register". If the status is "Non-Active" , then that record should not be displayed on the summary Page under "Cheques Due This Week".

    2) Is there a way to show "Blank cells" where there is no value to show instead of the "#NUM!"

    Can someone please help ! I have attached my sample sheet

    Thanks in Advance

    V
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    Put the formula in an IFERROR

    =IFERROR(formula,"")
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    06-24-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    Thanks special-K, it solved my second question ! Works well. Can someone help me with the first question too, please? Thanks

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    These formulas are shorter and include your "Active" check

    in B16
    =IFERROR(INDEX(Register!$D$3:$D$10000,SMALL(IF((Register!$C$3:$C$10000=$C$13)*(Register!M$3:M$10000="Active"),ROW($A$3:$A$10000)),ROW(A1))-(ROW(A$3)-1),COLUMN()-2,"")
    Array formula, use Ctrl-Shift-Enter

    copy across and down as far as F32

    Then
    in G16
    =IFERROR(INDEX(Register!$D$3:$D$10000,SMALL(IF((Register!$C$3:$C$10000=$C$13)*(Register!M$3:M$10000="Active"),ROW($A$3:$A$10000)),ROW(A1))-(ROW(A$3)-1),COLUMN()-3,"")

    copy down as far as H32
    Array formula, use Ctrl-Shift-Enter

  5. #5
    Registered User
    Join Date
    06-24-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    Hi Special-K

    Thanks for your prompt response. I copy pasted the formula as instructed by you, but its only showing the Date and Cheque No. value in column B & C. All other columns went completely blank.

    Also, it doesnt seem to exclude a record if its status in Register is "Non-Active". It shows all the records having a cheque date falling in current week.

    Thanks

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    Oops! I think it should be this

    =IFERROR(INDEX(Register!$D$3:$H$10000,SMALL(IF((Register!$C$3:$C$10000=$C$13)*(Register!$M$3:$M$10000="Active"),ROW($A$3:$A$10000)),ROW(A1))-(ROW(A$3)-1),COLUMN()-2),"")
    Array formula, use Ctrl-Shift-Enter

    copy across and down as far as F32

    Then
    in G16
    =IFERROR(INDEX(Register!$J$3:$K$10000,SMALL(IF((Register!$C$3:$C$10000=$C$13)*(Register!$M$3:$M$10000="Active"),ROW($A$3:$A$10000)),ROW(A1))-(ROW(A$3)-1),COLUMN()+3),"")

    copy down as far as H32
    Array formula, use Ctrl-Shift-Enter
    Last edited by Special-K; 08-20-2018 at 08:37 AM.

  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
    44,139

    Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    Vikrampnz... your profile says you have Excel 2003, yet your file is an .xlsx. Please amend your profile to shw what you ARE using and state the EARLIEST Excel version that this solution needs to work with.
    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

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    My second formula still doesnt work, checking it now...

  9. #9
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    Second formula should be

    =IFERROR(INDEX(Register!$J$3:$K$10000,SMALL(IF((Register!$C$3:$C$10000=$C$13)*(Register!$M$3:$M$10000="Active"),ROW($A$3:$A$10000)),ROW(E1))-(ROW(E$3)-1),COLUMN()-6),"")
    Array formula, use Ctrl-Shift-Enter

  10. #10
    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
    44,139

    Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    You have not answered my Q about your Excel version.

    If, by some chance, you are actually using Excel 2010 or later, you can also use a neat non-array formul, like this one in B16, copied over to F16 and down, with a variant in G16 (to take account of the fact that you are omitting one column from the raw data), copied across and down:

    =IFERROR(INDEX(Register!D:D,AGGREGATE(15,6,ROW(Register!$C$3:$C$801)/((Register!$C$3:$C$801=$C$13)*(Register!$M$3:$M$801="Active")), ROWS($A$1:A1))),"")

    see sheet.

    If you DO NOT have Excel 2010, or later, just ignore this post.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 08-20-2018 at 10:29 AM.

  11. #11
    Registered User
    Join Date
    06-24-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    88

    Thumbs up Re: Return Multiple Rows (Values) for Two Search Criteria using Index/Match Function

    Thanks a lot Special-K. Your formula works like a dream !! Cheers!

    Also, I am updating my profile for the version of Excel.

    Thanks guys!

+ 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 Multiple return values
    By Brawnystaff in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-28-2015, 10:27 AM
  2. [SOLVED] Return Multiple values from a column with index and match, and search criteria
    By marcusduton in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-15-2015, 09:59 PM
  3. Replies: 0
    Last Post: 07-08-2014, 09:51 AM
  4. Search for Multiple Criteria and Return all Rows that Match.
    By Kimston in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-29-2013, 11:46 AM
  5. [SOLVED] How to return multiple values that match a single search criteria?
    By JSallen in forum Excel General
    Replies: 4
    Last Post: 11-28-2012, 11:49 AM
  6. SOS:Return multiple values against multi criteria match and index function
    By nitesh_inin in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-26-2012, 05:45 PM
  7. [SOLVED] INDEX-MATCH function return '0' if search criteria not found
    By Ben.SFM in forum Excel General
    Replies: 2
    Last Post: 04-27-2012, 01:46 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