+ Reply to Thread
Results 1 to 9 of 9

Need help calculating overtime to date

  1. #1
    Registered User
    Join Date
    04-21-2004
    Posts
    19

    Need help calculating overtime to date

    So here's the deal... I need to calculate the total number of overtime hours to date. I've searched the threads but have come up short with what I need to accomplish.

    My spreadsheet has a TOTAL OVERTIME cell (A5). Cells B5 through BA5 represent the 52 weeks in a year. Each time a value is entered in any of those cells, I would like the TOTAL OVERTIME value to update (overtime is anything over 40 hours). So if 41 is entered in B5, the total overtime to date would be 1. If 44 is entered in C5, the total overtime to date would be 5 hours (1 hour from the previous week and 4 hours from this week).

    This is the formula I found, but this only does one 40 hour period. I need something a little more complex.

    =IF(A5>=40,SUM(A5-40),"0")

    Thanks in advance!

    Matt W

  2. #2
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    =SUMPRODUCT(--(B5:BA5>40),--(B5:BA5))-SUMPRODUCT(--(B5:BA5>40))*40

    or

    =SUMPRODUCT(--(B5:BA5>40),--(B5:BA5))-COUNTIF(B5:BA5,">40")*40

    HTH

    Steve

  3. #3
    Daniel CHEN
    Guest

    Re: Need help calculating overtime to date

    Try to use the following array function in cell A5
    (assume that the standard full time is 40 hours)

    =SUM(IF((($B$5:$BA$5)>40),$B$5:$BA$5-40))

    Best regards,
    ---
    Yongjun CHEN
    Project Oriented Spreadsheet Development and Consulting
    yjdchen@gmail.com - http://www.geocities.com/udqservices/UDQConsulting.htm



    =================================
    "BVHis" <BVHis.21dk5z_1136822406.1394@excelforum-nospam.com> wrote in
    message news:BVHis.21dk5z_1136822406.1394@excelforum-nospam.com...
    >
    > So here's the deal... I need to calculate the total number of overtime
    > hours to date. I've searched the threads but have come up short with
    > what I need to accomplish.
    >
    > My spreadsheet has a TOTAL OVERTIME cell (A5). Cells B5 through BA5
    > represent the 52 weeks in a year. Each time a value is entered in any
    > of those cells, I would like the TOTAL OVERTIME value to update
    > (overtime is anything over 40 hours). So if 41 is entered in B5, the
    > total overtime to date would be 1. If 44 is entered in C5, the total
    > overtime to date would be 5 hours (1 hour from the previous week and 4
    > hours from this week).
    >
    > This is the formula I found, but this only does one 40 hour period. I
    > need something a little more complex.
    >
    > =IF(A5>=40,SUM(A5-40),"0")
    >
    > Thanks in advance!
    >
    > Matt W
    >
    >
    > --
    > BVHis
    > ------------------------------------------------------------------------
    > BVHis's Profile:
    > http://www.excelforum.com/member.php...fo&userid=8593
    > View this thread: http://www.excelforum.com/showthread...hreadid=499411
    >




  4. #4
    Roger Govier
    Guest

    Re: Need help calculating overtime to date

    Hi

    One way
    =SUM(B5:BA5)-COUNTIF(B5:BA5,">0")*40

    Basically, add all the hours in the range then deduct 40 times the
    number of weeks that have data within them (>0).

    --
    Regards

    Roger Govier


    "BVHis" <BVHis.21dk5z_1136822406.1394@excelforum-nospam.com> wrote in
    message news:BVHis.21dk5z_1136822406.1394@excelforum-nospam.com...
    >
    > So here's the deal... I need to calculate the total number of
    > overtime
    > hours to date. I've searched the threads but have come up short with
    > what I need to accomplish.
    >
    > My spreadsheet has a TOTAL OVERTIME cell (A5). Cells B5 through BA5
    > represent the 52 weeks in a year. Each time a value is entered in any
    > of those cells, I would like the TOTAL OVERTIME value to update
    > (overtime is anything over 40 hours). So if 41 is entered in B5, the
    > total overtime to date would be 1. If 44 is entered in C5, the total
    > overtime to date would be 5 hours (1 hour from the previous week and 4
    > hours from this week).
    >
    > This is the formula I found, but this only does one 40 hour period. I
    > need something a little more complex.
    >
    > =IF(A5>=40,SUM(A5-40),"0")
    >
    > Thanks in advance!
    >
    > Matt W
    >
    >
    > --
    > BVHis
    > ------------------------------------------------------------------------
    > BVHis's Profile:
    > http://www.excelforum.com/member.php...fo&userid=8593
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=499411
    >




  5. #5
    John Michl
    Guest

    Re: Need help calculating overtime to date

    This seems to work. It is an array formula so you must use
    Ctrl-Shift-Enter to commit it.

    {=SUM(IF(B5:BA5>40,B5:BA5-40),0)}

    (Note the { } symbols are not entered but are automatically inserted
    when you commit with Ctrl-Shift-Enter.)

    - John
    www.JohnMichl.com


  6. #6
    JE McGimpsey
    Guest

    Re: Need help calculating overtime to date

    One way:

    =SUMPRODUCT(--(B5:BA5>40),(B5:BA5-40))

    In article <BVHis.21dk5z_1136822406.1394@excelforum-nospam.com>,
    BVHis <BVHis.21dk5z_1136822406.1394@excelforum-nospam.com> wrote:

    > So here's the deal... I need to calculate the total number of overtime
    > hours to date. I've searched the threads but have come up short with
    > what I need to accomplish.
    >
    > My spreadsheet has a TOTAL OVERTIME cell (A5). Cells B5 through BA5
    > represent the 52 weeks in a year. Each time a value is entered in any
    > of those cells, I would like the TOTAL OVERTIME value to update
    > (overtime is anything over 40 hours). So if 41 is entered in B5, the
    > total overtime to date would be 1. If 44 is entered in C5, the total
    > overtime to date would be 5 hours (1 hour from the previous week and 4
    > hours from this week).
    >
    > This is the formula I found, but this only does one 40 hour period. I
    > need something a little more complex.
    >
    > =IF(A5>=40,SUM(A5-40),"0")
    >
    > Thanks in advance!
    >
    > Matt W


  7. #7
    John Michl
    Guest

    Re: Need help calculating overtime to date

    This assumes that the minimum number of hours worked is 40. If someone
    worked 39 hours in a week, the total would not be correct.


  8. #8
    Registered User
    Join Date
    04-21-2004
    Posts
    19
    Thank you ALL for your replies! Your input was extremely helpful!

    Matt W

  9. #9
    Roger Govier
    Guest

    Re: Need help calculating overtime to date

    You're quite right, John, my argument is flawed.
    Your's, and the other solutions posted will solve the OP's problem
    without the error that mine would potentially have had.
    --
    Regards

    Roger Govier


    "John Michl" <waxwing1@gmail.com> wrote in message
    news:1136824060.664159.139020@o13g2000cwo.googlegroups.com...
    > This assumes that the minimum number of hours worked is 40. If
    > someone
    > worked 39 hours in a week, the total would not be correct.
    >




+ 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