+ Reply to Thread
Results 1 to 4 of 4

Need assistance with "not counting" total occurences??

  1. #1
    Registered User
    Join Date
    02-04-2013
    Location
    Lexington KY
    MS-Off Ver
    Excel 2010
    Posts
    4

    Need assistance with "not counting" total occurences??

    I have a situation where I have employees who receive credit for completing multiple jobs per day. This causes there to be multiple lines in my payroll file for a given employee with the same work date. I am attempting to count the number of days that an employee works in a week. Unfortunately my formula is summing every occurrence where an employee name matches a date within a given range. I need the formula to just count the number of days the employee works that week and not the total number of jobs he gets credit for completing. Hope that makes sense. I have attached a sample file. The formula I am in need of assistance with is in cell Q22. This employee completed 158 jobs for the week but he worked 6 out of 7 days. The six is what I am trying to arrive at is cell Q22. Your assistance would be greatly appreciated.

    This is the formula I am currently trying to make work:

    =SUM(IF($H$3:$H$15001=U22,IF($F$3:$F$15001=$T$3,1,0)))+SUM(IF($H$3:$H$15001=U22,IF($F$3:$F$15001=$T$4,1,0)))+SUM(IF($H$3:$H$15001=U22,IF($F$3:$F$15001=$T$5,1,0)))+SUM(IF($H$3:$H$15001=U22,IF($F$3:$F$15001=$T$6,1,0)))+SUM(IF($H$3:$H$15001=U22,IF($F$3:$F$15001=$T$7,1,0)))+SUM(IF($H$3:$H$15001=U22,IF($F$3:$F$15001=$T$8,1,0)))+SUM(IF($H$3:$H$15001=U22,IF($F$3:$F$15001=$T$9,1,0)))

    Thanks for your help!!!
    Attached Files Attached Files

  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: Need assistance with "not counting" total occurences??

    I didn't look at your file (too big for me!)...

    You can replace that long formula with this shorter one...

    =SUMPRODUCT(COUNTIFS($H$3:$H$15001,U22,$F$3:$F$15001,$T$3:$T$9))

    Not saying that'll solve your problem, though!
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,884

    Re: Need assistance with "not counting" total occurences??

    Add a Helper column, say column Q and use the formula: =COUNTIFS($F$3:$F3,$F3,$I$3:$I3,$I3) in cell Q3 and copy down.

    Then use the Helper column in your formula to select/count only the entries with a value of 1 in column Q.

    HTML Code: 

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,957

    Re: Need assistance with "not counting" total occurences??

    or just this....
    =COUNTIFS($F:$F,">="&$T$3,$F:$F,"<="&$T$9,$H:$H,$U19)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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