+ Reply to Thread
Results 1 to 4 of 4

Array that pulls list of data based on sum of multiple criteria

  1. #1
    Registered User
    Join Date
    05-12-2012
    Location
    sterling heights, mi
    MS-Off Ver
    Excel 2007
    Posts
    11

    Array that pulls list of data based on sum of multiple criteria

    Hello!

    I have a spreadsheet that tracks attendance and I need to create a list of outstanding instances. I already have an array that pulls the list of advisors that have a specific text (example 1), and now i need to pull a list of names that have less than 2 occurances.

    'Attendance' Table Example
    Name - Type - Date
    John Smith - 1Tardy - 1/1/15
    John Smith - 2Tardy - 1/2/15
    John Smith - Absence - 1/3/15
    Scott Jones - 1Tardy - 1/4/15
    John Smith - 3Tardy - 1/6/15
    John Smith - 4Tardy - 2/5/15

    EXAMPLE 1:
    The first array i have is: (O2 = "3Tardy")
    {=IFERROR(INDEX(Attendance!A$2:A$3000,SMALL(IF(Attendance!$B$2:$B$3000=$O$2,ROW(Attendance!A$2:A$3000)-ROW(Attendance!A$2)+1),ROWS(Attendance!A$2:Attendance!A2))),"")}

    So based on the above table it would only display John Smith.

    Now, what I'm trying to do is list the names of those that only have less than or equal to 2 instances in ColumnB with "*Tardy". Then, to make it more complicated, only display the name if the date range is in January. (start and end dates for each month are listed in another cell to refrence - N1 & O1). So, based on the above example it should only display Scott Jones in January and both John Smith and Scott Jones for February.

    Ive tried this:
    {=IFERROR(INDEX(Attendance!A$2:A$3000,SMALL(IF(COUNTIFS(Attendance!B2:B3000,"*Tardy",Attendance!C2:C3000,">="&N1,Attendance!C2:C3000,"<="&O1)<=2,ROW(Attendance!A$2:A$3000)-ROW(Attendance!A$2)+1),ROWS(Attendance!A$2:Attendance!A2))),"")}
    but it returns any name listed, even if they have more than 2 Tardies listed in the Attendance sheet.

    Any suggestions on how I can make this work like the first formula? what am I missing? and thank you in advance for any assistance!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Array that pulls list of data based on sum of multiple criteria

    Can you post a SMALL sample file and show us what result you expect?

    A SMALL file will have about 20 rows worth of data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    05-12-2012
    Location
    sterling heights, mi
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Array that pulls list of data based on sum of multiple criteria

    Ok, So I created a smaller version included below. The PA tab has been set up to show (A6:B15) any advisor that has 3 Tardies and is due for a write up, or 1 Absence (D6:E15). If they have been delivered it already it shows the date, if not the Team Leaders name that should deliver it.

    What I’m looking for is the data on the COY tab. The criteria I need is if the person has 2 tardies or less and no absences and between the dates listed in N2:O2. I just can’t figure out how to make it count any *Tardy listed on the attendance tab by each name.

    According to the data on the Attendance tab, selecting January on the COY tab should only produce Scott, Jones. (has 2 Tardies); and for February Morris, Zak.

    As I stated above i tried: {=IFERROR(INDEX(Attendance!A$2:A$3000,SMALL(IF(COUNTIFS(Attendance!B2:B3000,"*Tardy",Attendance!C2:C3000,">="&N1,Attendance!C2:C3000,"<="&O1)<=2,ROW(Attendance!A$2:A$3000)-ROW(Attendance!A$2)+1),ROWS(Attendance!A$2:Attendance!A2))),"")}
    but it will return every single name with a *Tardy in the attendance tab, and for each occurrence listed.
    Attached Files Attached Files
    Last edited by moses125; 02-07-2015 at 12:21 PM. Reason: wrong file attached

  4. #4
    Registered User
    Join Date
    05-12-2012
    Location
    sterling heights, mi
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Array that pulls list of data based on sum of multiple criteria

    Hello,

    So i was able to find a workaround (putting the sum totals in another location and using the formula to look there) but now i have another issue that i cant get to work.

    i have the array formula:
    {=IFERROR(INDEX(Attendance!I$2:I$3000,SMALL(IF(Attendance!$A$2:$A$3000=$E$2,ROW(Attendance!A$2:A$3000)-ROW(Attendance!$A$2)+1),ROWS(Attendance!A$2:Attendance!A2))),"")}
    Which pulls all records matching info in E2, but i need to add a second if: if(attendance!$C$2:$C$3000">="&Data!$D$14

    i tried nesting: {=IFERROR(INDEX(Attendance!I$2:I$3000,SMALL(IF(Attendance!$A$2:$A$3000=$E$2,if(attendance!$C$2:$C$3000">="&Data!$D$14
    ,ROW(Attendance!A$2:A$3000)-ROW(Attendance!$A$2)+1),ROWS(Attendance!A$2:Attendance!A2))),"")}
    Which would pull all records matching info in E2 and if date is greater than Data!D14 (1/1/15),but it still says theres an error in the code. any suggestions/tips on how to nest the second if?

+ 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. Replies: 1
    Last Post: 03-28-2014, 05:14 PM
  2. [SOLVED] Calculating list data based on multiple criteria
    By squigman in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-19-2013, 07:35 PM
  3. Replies: 0
    Last Post: 02-13-2012, 07:18 AM
  4. Return average and count from multiple criteria in a list or array of data
    By robcosta in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-22-2008, 03:18 AM
  5. Macro that pulls values out of an array based on its formatting
    By fecurtis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-28-2008, 09:29 AM

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