+ Reply to Thread
Results 1 to 7 of 7

problem with INDEX([...],SMALL(IF[...],ROW to list results based on more than one criteria

  1. #1
    Registered User
    Join Date
    10-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    problem with INDEX([...],SMALL(IF[...],ROW to list results based on more than one criteria

    Hi all,

    I'm new to the INDEX formula (and also new to this forum) and I'm having an issue trying to list matches for more than one criteria. I have a working formula of:
    {=INDEX(Data001!$A$1:$C$101,SMALL(IF(Data001!$B$1:$B$101=$E$6,ROW(Data001!$B$1:$B$101)),ROW(1:1)),1)}

    which allows me to choose a name from a dropdown (E6) and it returns every report number that person has done. I'm trying to have it also filter the results and show every instance of the person's name, within the pay period range. I tried an IF(AND( but that didn't work, I tired an IF([...],IF([...], but I must be doing something wrong with the syntax. I'd like to have to formula be:
    {=INDEX(Data001!$A$1:$C$101,SMALL(IF(Data001!$B$1:$B$101=$E$6,IF(Data001!$C$1:$C$101>$E$2,IF(Data001!$C$1:$C$101<$F$2,ROW(Data001!$B$1:$B$101)))),ROW(1:1)),1)} but it returns a#NUM! error. Can someone help?

    Any suggestions? I've attached a sample.
    Attached Files Attached Files
    Last edited by cows; 10-21-2013 at 11:41 PM.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: problem with INDEX([...],SMALL(IF[...],ROW to list results based on more than one crit

    Try this in A2 =IFERROR(INDEX(Data001!$A$1:$C$101,SMALL(IF(Data001!$B$1:$B$101=$E$6,ROW(Data001!$B$1:$B$101)),ROW(1:1)),1),"") and drag down till A100

    =IFERROR(VLOOKUP(A2,Data001!A:B,2,FALSE),"") in B2 drag down till B100
    =IFERROR(VLOOKUP(A2,Data001!A:C,3,FALSE),"") in C2 and drag down Till C100.

    Why upto 100 rows down ? Check your data with fred it has more info than 20 rows
    Last edited by hemesh; 10-22-2013 at 06:23 AM.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: problem with INDEX([...],SMALL(IF[...],ROW to list results based on more than one crit

    Hi,

    Actually your attempt was very nearly correct. However:

    1) There are no records matching those date criteria for Diane!! (Hence the #NUM! error)

    2) ROWS($1:1) is preferable to ROW(1:1) as the parameter in the SMALL function as it is not susceptible to row insertion.

    All in all, (again, array-entered) in A2:

    =IFERROR(INDEX(Data001!$A$1:$A$101,SMALL(IF(Data001!$B$1:$B$101=$E$6,IF(Data001!$C$1:$C$101>$E$2,IF(Data001!$C$1:$C$101<$F$2,ROW(Data001!$B$1:$B$101)))),ROWS($1:1))),"")

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: problem with INDEX([...],SMALL(IF[...],ROW to list results based on more than one crit

    In A2 (Array Formula)
    =IFERROR(INDEX(Data001!$A$1:$C$101,SMALL(IF((Data001!$B$1:$B$101=$E$6)*(Data001!$C$1:$C$101>=Summary!$E$2)*(Data001!$C$1:$C$101<=Summary!$F$2),ROW(Data001!$B$1:$B$101)),ROW(1:1)),1),"")

    In B2
    =IFERROR(VLOOKUP(A2,Data001!A:B,2,FALSE),"")

    In C2
    =IFERROR(VLOOKUP(A2,Data001!A:C,3,FALSE),"")

    Dragdown.

  5. #5
    Registered User
    Join Date
    10-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: problem with INDEX([...],SMALL(IF[...],ROW to list results based on more than one crit

    Quote Originally Posted by XOR LX View Post
    =IFERROR(INDEX(Data001!$A$1:$A$101,SMALL(IF(Data001!$B$1:$B$101=$E$6,IF(Data001!$C$1:$C$101>$E$2,IF(Data001!$C$1:$C$101<$F$2,ROW(Data001!$B$1:$B$101)))),ROWS($1:1))),"")
    Thank you for this- it gives the desired results! I guess I've been misunderstanding a couple details about the array formula. I'll be applying this to my production spreadsheet which references a table of 50,000 rows and has previously been a pain to sort out!
    Last edited by cows; 10-22-2013 at 12:57 PM.

  6. #6
    Registered User
    Join Date
    10-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: problem with INDEX([...],SMALL(IF[...],ROW to list results based on more than one crit

    I'm confused by the "*" between the IF statements in as well, in kvsrinivasamurthy's post, is that a wildcard or to multiply? The formula didn't work for me, I did get a working version from XOR LX though.

    Thank you all for the assistance!
    Last edited by cows; 10-22-2013 at 12:56 PM.

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: problem with INDEX([...],SMALL(IF[...],ROW to list results based on more than one crit

    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. How to show results of index small if from left to right
    By suton in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-17-2013, 06:39 AM
  2. Index small if using choice of columns based on cell
    By Trax in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-24-2013, 07:24 AM
  3. List Results Based on Multiple Criteria
    By scottcnichols in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-23-2013, 12:30 PM
  4. [SOLVED] Index/Rank Problem, based on criteria, if match then tiebreaker
    By brotherwo in forum Excel General
    Replies: 4
    Last Post: 08-29-2012, 10:14 AM
  5. Macro needed: list results based on criteria
    By nantoy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2012, 09:18 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