+ Reply to Thread
Results 1 to 18 of 18

Total time calculating incorrectly

  1. #1
    Registered User
    Join Date
    06-04-2018
    Location
    London, UK
    MS-Off Ver
    Excel 2016
    Posts
    9

    Total time calculating incorrectly

    Good day everyone,

    I have created a timesheet for myself and my team so we can track our salary (after several mistakes by the payroll department), we work shifts over a 24/7 operation over a 4 week period. Here is an example of our shift patters, 07:00-15:00 (early shift) 15:00-23:00 (late shift) 23:00-07:00 (night shift).

    I have set up a formula to calculate all the various shift patterns earlies, lates and nights, the daily totals work. However, when adding up the weekly totals, it doesn't add up correctly. An example of the a cell where the formula doesn't calculate correctly is K14.

    Regards,

    Dave
    Attached Files Attached Files
    Last edited by macrocosm.nomad; 06-04-2018 at 01:57 PM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Timesheet Help

    no data entered ...????

    and in K14 why not ..

    =SUM(D14:J14)

  3. #3
    Registered User
    Join Date
    06-04-2018
    Location
    London, UK
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Timesheet Help

    Thank you for the reply,

    I have uploaded another version which is filled out to show an example. I did originally have that formula, but if I remember correctly, it was misbehaving, so that's why I did each cell separately.

    Regards,

    Dave
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Timesheet Help

    You need to format the Total cells as [h]:mm to cater for times over 24 hours

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Timesheet Help

    And change your heading ..."Total time calculating incorrectly" (or similar) see below ...

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  6. #6
    Registered User
    Join Date
    06-04-2018
    Location
    London, UK
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Timesheet Help

    I have formatted the cells as time with the 4 digit 24hr hour format i.e. 13:30. Please see the attached image. Time.PNG

    Regards,

    Dave

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Timesheet Help

    See attached and format used in K14::
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-04-2018
    Location
    London, UK
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Timesheet Help

    Thank you for your reply, sadly that doesn't work either, when putting in a night shift, it comes up with a total of 560:00.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Timesheet Help

    Post a file showing the incorrect value.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Timesheet Help

    See attached with Night shift: nothing wrong as far As I can see. Check J50.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-04-2018
    Location
    London, UK
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Total time calculating incorrectly

    I am not too sure if it is due to the original formula that I have used to calculate whether the shifts go past midnight or not i.e. =D9-D8+(D9<D8)*24

    Please see the attached file.
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Total time calculating incorrectly

    You changed all cells rather than just those in Column K.

    See file I posted.

  13. #13
    Registered User
    Join Date
    06-04-2018
    Location
    London, UK
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Total time calculating incorrectly

    I have even tried the file that you have posted, and in week one, it still displays 576:00 as as the grand total for an early, a late and a night shift. It appear to be the way that the cell F8 is calculating the night shift. After I have filled out 23:00 and when I show the formulas using CTRL ` the values are different between F8 and G30. I just can't see where it is going wrong.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    06-04-2018
    Location
    London, UK
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Total time calculating incorrectly

    I have resolved the strange issue by copy and pasting from the cell where the formulas work and pasting into the place where they don't.

    I would like to say thank you so much for all of your help this evening.

    Regards,

    Dave

  15. #15
    Registered User
    Join Date
    06-04-2018
    Location
    London, UK
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Total time calculating incorrectly

    I thought it was solved, but sadly it doesn't seem to be working again. I think that it is the way that it is formatting the the value that I am entering or perhaps it is the way that I am entering the value, I am literally typing 23:00 I am not too sure if this is the issue?

  16. #16
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Total time calculating incorrectly

    Your formula should be ..

    =D9-D8+(D9<D8)*1 (not 24)

  17. #17
    Registered User
    Join Date
    06-04-2018
    Location
    London, UK
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: Total time calculating incorrectly

    That's amazing, it seems to have resolved the issue.

    Once again, I would like to thank you for all of your help, it has been years since I have used Excel in-depth like this and most of it came from Google.

    Regards,

    Dave

  18. #18
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Total time calculating incorrectly

    that 560 value in col F is caused by adding 24 days to the value.

    change the formula to

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and it will give you 8 hours as it is supposed to.

    Times are a fraction of 1 1 hour is in decimalvalue 0,04166666667 24 hours in decimal 1
    when endtime is smaller then begin time your old formula caused a calucations of 1*24 = 24 is 24*24 hours = 576 hours - (23:00-7:00=16 hours) = 560 hours
    combined with the formaterror it gives you strange results

    You have been struggling with 2 errors (in format and in formula) that by chance displayed the expected value.

    In your file I have made some calculations and formats to show you the effect. hop that will help you understand the challenges of calculating with time in excel.
    Attached Files Attached Files

+ 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. Need help by Timesheet
    By MoFaSa in forum Excel - New Users/Basics
    Replies: 17
    Last Post: 02-19-2014, 07:06 PM
  2. Timesheet and V-Look ups
    By dawnvolk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-09-2014, 03:29 PM
  3. [SOLVED] Need help with a timesheet!
    By AnnaG87 in forum Excel General
    Replies: 2
    Last Post: 12-12-2013, 02:24 PM
  4. Timesheet
    By greg123 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-26-2012, 03:38 AM
  5. Timesheet Help
    By swoznia in forum Excel General
    Replies: 3
    Last Post: 05-25-2012, 02:51 PM
  6. TimeSheet-401
    By DenniSys in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2010, 05:43 PM
  7. 24 hr timesheet
    By lee maroney in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-31-2006, 12:52 PM
  8. timesheet with OT
    By mike in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-14-2005, 08:05 PM

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