+ Reply to Thread
Results 1 to 5 of 5

SUM/Count if 2 conditions are met

  1. #1
    Registered User
    Join Date
    12-15-2006
    Posts
    18

    SUM/Count if 2 conditions are met

    Hi guys,

    i have a spreadsheet where people type in their email into cell C4 on a sheet named VIEW.

    What i need is cell C5 (on the VIEW sheet) to return a count of how many people have passed a course AND align into the named person in C4. (2 criteria)

    i have all the raw data on a seperate sheet called "DATA"

    Column J on DATA contains the line manager email address (1st criteria)

    Column T on DATA contains the status (Passed, Failed, Incomplete, Not Started)

    This is the formula that i have in cell C5:


    {=SUM((DATA!J1:J10000, C4)*(DATA!T2:T10000="Passed"))}

    But this returns the error "#VALUE!"

    Can anybody point me in the direction of what ive done wrong and how to fix this?

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =SUMPRODUCT((Data!J2:J10000=C4)*(Data!T2:T10000="Passed"))

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-15-2006
    Posts
    18
    Thanks for your help!

    It worked except i had to switch the J and T columns around to get the figure i was looking for, but thank you very much!!

    Is there a maximum of criteria i can have? and is it just a case of adding the extra arguments before the present ones? i.e. to find only those passed in 2007 (Year column is F)

    e.g.

    =SUMPRODUCT((Data!F2:F10000="2007")*(Data!T2:T10000=C4)*(Data!J2:J10000="Passed"))

    Thanks again
    Rich

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good evening mrmiddleman

    SUMPRODUCT will accept 30 arguments, and yes - they pretty much follow the syntax that Noob gave to you earlier. You can also use SUMPRODUCT to conditionally sum lists as well as count matches.

    My add-in, available via the link below, has a utility that can generate SUNPRODUCT formulae for you without you having to worry about the syntax. Just go to Ultimate > Formulae > Multiple SumIf Generator. This interface will allow up to 7 conditions to be added.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  5. #5
    Registered User
    Join Date
    12-15-2006
    Posts
    18
    Thanks Dom,


    =SUMPRODUCT((DATA!T2:T10000="Passed")*(DATA!J2:J10000=DISPLAY!C4))
    =SUMPRODUCT((DATA!T2:T10000="Not Started")*(DATA!J2:J10000=DISPLAY!C4))
    =SUMPRODUCT((DATA!T2:T10000="Failed")*(DATA!J2:J10000=DISPLAY!C4))
    =SUMPRODUCT((DATA!T2:T10000="Incomplete")*(DATA!J2:J10000=DISPLAY!C4))

    I now have a 1x4 table that contains the raw data that is pulled from the above formula.

    The Variable (Employee name) is in cell C4. It pulls a total for each of the course status' for the direct reports of whoever is named in C4.

    I have no idea how to get the next part. (I thought of using a lookup but the amount of raw data changes so often the only thing that remains constant are the column headings and that the data in column T being one of the above 4 options.)

    Under this table, i require a list of only those people who have "Not Started" "Failed" or "Incomplete" a course.

    The List must contain direct reports Name (From Data! sheet column B) and The Course title (from Data! sheet column K).

    Anybody have an idea?

    Your help is always appreciated!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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