+ Reply to Thread
Results 1 to 16 of 16

Total hours worked each day

  1. #1
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Total hours worked each day

    Hi,

    I need a formula to show total hours worked each day. The formula I currently use counts the number of cells populated but since changing start and finish times to include quarter to and quarter past the hour I am now getting an inaccurate calculation.

    I have attached a sample workbook, Sheet 1 column Y is where the formula is needed. As you can see Y5,Y6,Y13 and Y14 are displaying 8.5 hours when they should be 7.5. I can't pull this data from columns V and W as when cells are populated OUT or H these times are not displayed.

    All other calculations in column Y are correct and for example, where F3:M3 shows 8 hours worked this includes a half hour unpaid break J3 so total paid hours in column Y is 7.5

    D5:L5 is 9 populated cells including I5 the half hour unpaid break, but as can be seen in V5:W5 there is only 8 hours at work and taking off I5 leaves 7.5 total hours paid.

    There is a legend on Sheet 3 to show what all the colors represent.
    Attached Files Attached Files

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Total hours worked each day

    =COUNTA(C5:T5) = 9
    =(SUM(COUNTIF(C5:T5,{"LL","LE","H.5","OUT.5","0.5"})/2)) = 0.5 as you have and LL
    then
    9-.5 = 8.5

    so correct
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Total hours worked each day

    Thanks for the reply, perhaps I didn't explain correctly as the formula I have is bringing back incorrect results for what I need.

    As you say, what my current formula does is correct but in relation to D5:L5, there is still only a work time of 7.5 hours not 8.5 as the start finish times dictate in V5:W5

    Tez

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Total hours worked each day

    But Y is using C5 to T5 to calculate the hours - not the start time

    in D5 you have a value 0.75 - Why ?
    The start time , should that be 06:15 , as worked 0.75 of the hour and 0.25 as the start time suggested - hence the .5 difference
    and NOT 6:45
    0.25 in D5 should show 6:45 in the start time , - 0.75 should show as 6:15
    and so the work is correct, the starttime is wrong base on whats in cells D5

    I'm need to look further at your formula for calculating start times , based on a value in the cell
    Last edited by etaf; 02-26-2018 at 09:12 AM.

  5. #5
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Total hours worked each day

    The formula in Y was used before I started using .25 & .75 start/finish times and worked fine. Now that work times have changed I think I need a whole new formula.

    The formula to calculate times looks at the left number in Row 2, so .75 in D5 adds to 6 from D2 resulting in 6.45

    It may be that the formulas in V & W need to change to look at the right number in Row 2?
    Last edited by ~TaC~; 02-26-2018 at 09:52 AM.

  6. #6
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Total hours worked each day

    I think your example is strange as the values do not make sense. My instinct would be to sum all the cells to get the hours and then add 0.5 for each cell that was with the required text in it
    =IF(A3="","",SUM(C3:T3)+(SUM(COUNTIF(C3:T3,{"LL","LE","H.5","OUT.5","0.5"})/2)))
    or
    =IF(A3="","",SUM(C3:T3)+(SUM(COUNTIF(C3:T3,{"LL","LE","H.5","OUT.5","0.5"})/2)))+SUM(COUNTIF(C3:T3,{"OUT","H"}))
    Last edited by davsth; 02-26-2018 at 09:37 AM.

  7. #7
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Total hours worked each day

    That would still show result of 8 hours paid for C5:T5 but should be 7.5 as worked times are 6.45-14.45 then taking off half hour unpaid (LL)

  8. #8
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Total hours worked each day

    If you recorded the hours that are worked in each hour it would work. The way you are currently recording means 0.75 can take different values depending where it appears

    I interpreted d5 to mean 0.75 hours were worked, not the start time was 6:45

  9. #9
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Total hours worked each day

    I think I just fixed it but thanks any way guys.

    I added "0.75","0.25" to my original formula

    =IF(A5="","",COUNTA(C5:T5)-(SUM(COUNTIF(C5:T5,{"LL","LE","H.5","OUT.5","0.75","0.25","0.5"})/2)))

    Probably not the best way but gets the result I'm after, really don't know why it took me so long to think of it lol

  10. #10
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Total hours worked each day

    be careful what you wish for, as the above approach would be more simplistic, now you have to evaluate the first and last value in the row and adjust accordingly if it is <1

    =IF(A3="","",COUNTA(C3:T3)-(SUM(COUNTIF(C3:T3,{"LL","LE","H.5","OUT.5","0.5"})/2)))+ IF(INDEX(C3:T3,MATCH(TRUE,INDEX((C3:T3<>0),0),0))<1,-INDEX(C3:T3,MATCH(TRUE,INDEX((C3:T3<>0),0),0)),0)-IF(LOOKUP(2,1/(C3:T3<>""),C3:T3)<1,1-LOOKUP(2,1/(C3:T3<>""),C3:T3),0)

  11. #11
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Total hours worked each day

    your formula only works as the start and the end add up to one full hour what if l5 was 0.25?

  12. #12
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Total hours worked each day

    I see I was a little to quick to think I fixed my problem

    I think the formula in Y needs discarding and starting from scratch

  13. #13
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,732

    Re: Total hours worked each day

    OR as i posted the start and end times to be shown correctly with the same meaning for 0.75 and 0.25 in the Hourly cells
    and has already been posted 0.75 means different things

  14. #14
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Total hours worked each day

    And how would I do that, after all I did come here for help!

  15. #15
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Total hours worked each day

    The first question is what is wrong with the answers already provided


    if you change how the hours are recorded post 6 works, if you insist on recording as you are post 10 works

    If they don't tell us where they don't.

    If they do then mark the thread as solved

  16. #16
    Registered User
    Join Date
    11-12-2017
    Location
    Stafford, England
    MS-Off Ver
    365
    Posts
    184

    Re: Total hours worked each day

    My apologies, took me a while to understand what you were meaning by recording the time differently.

    D5 being 15 minutes worked = 0.25
    L5 45 minutes worked = 0.75

    I was calculating as time so 6.45 would be 0.75 past the hour, thats what confused me.

    Post #6 so far so good, thanks for your help and patients

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Formula to calculate hours worked w/lunch or w/o + OT column only total after 40 hours
    By blinhart in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-31-2023, 11:14 AM
  2. Total hours worked for the week
    By bud11dy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-15-2013, 09:18 AM
  3. Replies: 4
    Last Post: 02-12-2013, 07:01 AM
  4. Replies: 2
    Last Post: 02-11-2013, 02:26 PM
  5. Total Hours worked per Job or Worker
    By DJohnson2 in forum Excel General
    Replies: 2
    Last Post: 07-19-2012, 11:10 AM
  6. Replies: 6
    Last Post: 05-03-2010, 12:03 PM
  7. total of hours worked
    By carolynkeene in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2006, 03:29 PM

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