+ Reply to Thread
Results 1 to 5 of 5

Work Week Hours Calculation problem

  1. #1
    Registered User
    Join Date
    12-22-2012
    Location
    Hamden, Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    5

    Work Week Hours Calculation problem

    I am creating a work schedule per week.

    I have done a simple formula =(A#-A#)+(B#-B#).... to calculate hours worked per week. Since one value of A had the time in, and the other value of A had time out, I need to do that for each day. Is there an easier formula to calculate that?

    Also, some days there are workers who have to work until closing. Closing is difficult to put a time, but to give a general value of 8:00 PM, how do I write that into the formula so that it remains as Close, but has the value of 8:00 PM.

    I will upload the file with no names on it, so if it helps.

    Thanks, laughingasian.
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Work Week Hours Calculation problem

    You should format the merged cell J5/J6 as [h]:mm, otherwise the hours will wrap at 24, then you can put this formula in that merged cell:

    =(IF(C6="Close",--"20:00:00",C6)-C5)+(IF(D6="Close",--"20:00:00",D6)-D5)+(IF(E6="Close",--"20:00:00",E6)-E5)+(IF(F6="Close",--"20:00:00",F6)-F5)+(IF(G6="Close",--"20:00:00",G6)-G5)+(IF(H6="Close",--"20:00:00",H6)-H5)+(IF(I6="Close",--"20:00:00",I6)-I5)

    and then this can be copied down. Note that you have a space before "Close" in E18, so you will need to get rid of the space to avoid the #Value error.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-22-2012
    Location
    Hamden, Connecticut
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Work Week Hours Calculation problem

    Hi there.

    I have J5/J6 as [h]:mm already, thank you.

    I cleared the space before Close, nice catch.

    What is the -- between Close and 20:00:00? What function does that do?

    laughingasian

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Work Week Hours Calculation problem

    That is the double-unary minus, which effectively multiplies by -1 and then by -1 again (i.e. equivalent to multiplying by 1). I put the time element in as a string value so that it is easier to read, but that string needs to be converted into a numeric value, which is what the -- does.

    Hope this helps.

    Pete

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Work Week Hours Calculation problem

    I'm posting this, for what it's worth, in response to another member that PMd me.

    It might be relevant to the OP.

    Get shot of the merged cells.

    Fill in the closing times for each day in P2:V2 to see the changes in column J.

    Apologies Pete I haven't modified your formula to allow for this possibility.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ 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