+ Reply to Thread
Results 1 to 11 of 11

Cells formatted as "time" do not calculate correctly

  1. #1
    Registered User
    Join Date
    11-14-2013
    Location
    Wilton, CA
    MS-Off Ver
    Excel 2013 MAC version
    Posts
    18

    Cells formatted as "time" do not calculate correctly

    Forum Users: I have a spreadsheet where the Over Time column does not calculate correctly. I have copied my excel sheet and posted below - also I copied the formula for the Over Time next to the column. would appreciate if someone could help me.


    Today's Date 4/18/18 8:00

    Current Time 12:26 6:00
    0:30
    Driver Bid Start P&D Hours Total Hrs O/T
    5:00 5:00 12:30 13:00 4:30 Formula for Overtime: =IF(AA24="","",IF(Y24<=$AA$2,"",Y24-$AA$2))
    5:00 10:30 1:26 1:56 17:26 The following two columns show O/T that are errors....
    5:00 12:00 23:56 0:26 15:56

    Thanks for helping me on this.

    TigerA

  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,176

    Re: Cells formatted as "time" do not calculate correctly

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    11-14-2013
    Location
    Wilton, CA
    MS-Off Ver
    Excel 2013 MAC version
    Posts
    18

    Re: Cells formatted as "time" do not calculate correctly

    Note: When Drivers start later and as the day progresses, the Overtime column starts reflecting excessive hours. Earlier driver start times reflect the correct overtime.

    Cells are formatted as Time, i.e., 13:30. Also I have a problem adding the time at the bottom of the sheet using the SUM formula.

    Appreciate your help in this matter.

    TigerA
    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,176

    Re: Cells formatted as "time" do not calculate correctly

    The problem is the result of simply taking a TIME (Hours/Minutes) from a DATE/TIME (NOW()): you need either just subtract TIMES or DATE/TIMES.

    So currently you are not calculating hours worked or OT hours: you are simply recording a (DATE)/TIME i.e NOW() - (another time) which simply results in a DATE/TIME so formatting as TIME simple shows a time.

    For HOURS calculation, the cells need to be formatted as hh:mm. And your calculation needs revising so you work with DATE/TIMES (if calculations run over a day e.g start at 22:00 and finish at 08:00 next day.


    and why this (SUM twice)

    =SUM(AA24:AA69,AA24:AA69) ?

    Your summation of hours should be formatted as [h]:mm but you will get wrong results because you are actually adding a date/time field

    And this working in "Real time" (In the formulae) as you are using NOW() as a base: so all data constantly changes.

    e.g.

    =IF(W24="","",+$W$4-W24)

    I assume a macro "hard codes" a time (based on "Stop" button ?) rather than use A4????
    Last edited by JohnTopley; 04-20-2018 at 05:16 AM.

  5. #5
    Registered User
    Join Date
    11-14-2013
    Location
    Wilton, CA
    MS-Off Ver
    Excel 2013 MAC version
    Posts
    18

    Re: Cells formatted as "time" do not calculate correctly

    Thank you - I'll make the corrections when I get to work. I really appreciate your response, I have been wrestling with this for a week.

    TigerA

  6. #6
    Registered User
    Join Date
    11-14-2013
    Location
    Wilton, CA
    MS-Off Ver
    Excel 2013 MAC version
    Posts
    18

    Re: Cells formatted as "time" do not calculate correctly

    Thanks - I am in the process reformatting the cells as you stated in your reply. Is there a way I can put time in the Current Time field and use the "Refresh" button to update the time. For example, if I put in 09:00 and at 9:30 I want to see the "Total Hours", it would update the field. The Refresh button is much easier than typing in the time - we refer to this sheet constantly.

    You have been extremely helpful - Thanks. TigerA

  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,176

    Re: Cells formatted as "time" do not calculate correctly

    Please Login or Register  to view this content.
    This ???

  8. #8
    Registered User
    Join Date
    11-14-2013
    Location
    Wilton, CA
    MS-Off Ver
    Excel 2013 MAC version
    Posts
    18

    Smile Re: Cells formatted as "time" do not calculate correctly

    Thanks John - it works perfectly. Thanks so much for your help.

    This was a two week case of frustration - TigerA.

  9. #9
    Registered User
    Join Date
    11-14-2013
    Location
    Wilton, CA
    MS-Off Ver
    Excel 2013 MAC version
    Posts
    18

    Re: Cells formatted as "time" do not calculate correctly

    Team Excelforum - Is there a macro or IF statement or ISNUMBER statement that would check a cell to determine if it has a macro in it - and if it does, will overwrite that macro with a VALUE?

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: Cells formatted as "time" do not calculate correctly

    Please start a new thread for this new request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  11. #11
    Registered User
    Join Date
    11-14-2013
    Location
    Wilton, CA
    MS-Off Ver
    Excel 2013 MAC version
    Posts
    18

    Re: Cells formatted as "time" do not calculate correctly

    Where do I go to post a new thread? I have looked over the header and cannot find where to post. Could someone help me?

    TigerA

+ 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. Replies: 7
    Last Post: 11-08-2015, 03:57 PM
  2. Replies: 1
    Last Post: 03-31-2014, 08:39 PM
  3. [SOLVED] How to convert "26:38:00" to "26:38" when the cell is formatted as Time?
    By PistachioPedro in forum Excel General
    Replies: 2
    Last Post: 11-15-2013, 06:49 PM
  4. [SOLVED] problem with replacing values formatted as "time"
    By inglese in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2013, 09:08 PM
  5. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  6. cells formatted the same are showing "0.00" vs. "-"
    By maddux70 in forum Excel General
    Replies: 3
    Last Post: 04-14-2008, 11:55 AM
  7. [SOLVED] cells formatted to tick when text value "Y" if or null if "N"
    By Jay in forum Excel General
    Replies: 7
    Last Post: 01-13-2006, 05:20 AM

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