+ Reply to Thread
Results 1 to 5 of 5

formula to create a single count covering multiple conditions

Hybrid View

shaneb formula to create a single... 04-07-2010, 10:17 AM
rwgrietveld Re: formula to create a... 04-07-2010, 10:31 AM
DonkeyOte Re: formula to create a... 04-07-2010, 10:53 AM
shaneb Re: formula to create a... 04-07-2010, 11:04 AM
shaneb Re: formula to create a... 04-07-2010, 10:57 AM
  1. #1
    Registered User
    Join Date
    04-07-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Post formula to create a single count covering multiple conditions

    Hi all,

    I am trying to find a formula which looks at several columns (Application ID, District, Team Type and Status) to help me populate a table.

    Here is the sample data (also in the attached spreadsheet)


    App ID Student Team Type District Status
    1 James School FGR Successful
    1 Mary School FGR Successful
    2 Margaret Individual SDR Successful
    3 Tom School NDY Unsuccessful
    3 Peter School NDY Unsuccessful
    4 Meagan Individual FGR Unsuccessful
    5 Michelle School NDY Unsuccessful
    5 Fiona School NDY Unsuccessful
    6 Mark School NDY Successful
    6 Ryan School NDY Successful
    6 Vince School NDY Successful


    I am hoping the table will show for each District the breakdown of each Team Type and how many had a status of "Successful"

    I discovered a formula (which I don't fully understand) in another thread which I modified for the Team Type "Individual" that appears to work (not sure if there is an easier method):

    SUMPRODUCT(($D$2:$D$12="FGR")*($C$2:$C$12="Individual"))

    but modifying the formula for "School" Team type eg

    SUMPRODUCT(($D$2:$D$12="NDY")*($C$2:$C$12="School"))

    doesn't work because it counts the individuals in the team (ie each row) rather than counting the team once.

    Any ideas to replace the ? in the table (extract below) with a formula would help keep me sane :-)


    District Total Successful
    FGR ? ?
    SDR ? ?
    NDY ? ?
    Total 0 0


    I am need a formula that will work in Excel 2003 and 2007

    Thanks for taking the time to read this and hopefully you can help or point me in the right direction.

    Shane
    Attached Files Attached Files
    Last edited by shaneb; 04-07-2010 at 11:43 AM. Reason: Changed Status to Solved

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: formula to create a single count covering multiple conditions

    Could use the multiplicatons, another wat is use a double --


    =SUMPRODUCT(--($D$2:$D$12=$A23),--($C$2:$C$12="School"))

    see attchement
    Attached Files Attached Files
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: formula to create a single count covering multiple conditions

    The formula you would want for D23 using SUMPRODUCT would be:

    =SUMPRODUCT(--($D$2:$D$12=$A23),--($C$2:$C$12=D$21),--(MATCH($A$2:$A$12&"@"&$C$2:$C$12,$A$2:$A$12&"@"&$C$2:$C$12,0)=(ROW($A$2:$A$12)-ROW($A$2)+1)))
    copied down

  4. #4
    Registered User
    Join Date
    04-07-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: formula to create a single count covering multiple conditions

    Wow
    Thanks DonkeyOte

    It works

    Pretty clever formula. Way beyond my comprehension.

    and I was able to extend the formula you posted to work out the Successul "School" Team Types in a District - eg

    =SUMPRODUCT(--($D$2:$D$12=$A23),--($C$2:$C$12=D$21),--($E$2:$E$12="Successful"),--(MATCH($A$2:$A$12&"@"&$C$2:$C$12,$A$2:$A$12&"@"&$C$2:$C$12,0)=(ROW($A$2:$A$12)-ROW($A$2)+1)))

    Thanks again

    Shane
    Last edited by shaneb; 04-07-2010 at 11:34 PM.

  5. #5
    Registered User
    Join Date
    04-07-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: formula to create a single count covering multiple conditions

    Thanks Ricardo for the quick reply,

    the formula is a great alternative for the "Individual" Team Type

    unfortunately it still counts every row for the "School" Team Type

    fyi : further to the right in cells G20:H26 I placed a table with the expected results

    Shane

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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