+ Reply to Thread
Results 1 to 12 of 12

Please help - Unable to Subtract Correct Time

Hybrid View

  1. #1
    Registered User
    Join Date
    09-15-2015
    Location
    Malaysia
    MS-Off Ver
    Office 365
    Posts
    45

    Please help - Unable to Subtract Correct Time

    Dear All,

    I created a format to calculate Overtime calculations but I problem in time subtraction, for example Time In - 07.00 hours to 08.30 hours is 1.5 hour of Overtime but each time I need to input the time as Time In - 07.00 and Time Out - 08.50 to get 1.5 hours.

    Tried changing the time format but every time I am getting 00.00 or 7.12.

    Please help to relook at the formula and advise where I have gone wrong.

    Thank you very much.

    Regards,

    Ravin
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Please help - Unable to Subtract Correct Time

    Hi, welcome to the forum

    What you need to understand about dates and times in excel is...

    a date is just a number representing the number of days passed since 1/1/900...and then formated in a way that we recognise as a date. So, for instance, today (Wed Sep 2015) is actually 42263

    Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75

    If you enter time in teh correct format (08:30 etc), excel will calc correctly. If you enter time as whole numbers (8.3 or 8.5) you will need to do extra calcs to convert it to time
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-15-2015
    Location
    Malaysia
    MS-Off Ver
    Office 365
    Posts
    45
    Thank you for advise and guidance.

    Ravin


    Quote Originally Posted by FDibbins View Post
    Hi, welcome to the forum

    What you need to understand about dates and times in excel is...

    a date is just a number representing the number of days passed since 1/1/900...and then formated in a way that we recognise as a date. So, for instance, today (Wed Sep 2015) is actually 42263

    Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75

    If you enter time in teh correct format (08:30 etc), excel will calc correctly. If you enter time as whole numbers (8.3 or 8.5) you will need to do extra calcs to convert it to time

  4. #4
    Registered User
    Join Date
    09-15-2015
    Location
    Lodz, Poland
    MS-Off Ver
    2010
    Posts
    16

    Re: Please help - Unable to Subtract Correct Time

    Yes, you should put time in format HH:MM. However I would suggest to put hours and minutes in separate columns and than calculate it with ‘Time’ function. I don’t know how many people will use this file, but it will sure prevent format mistakes.

  5. #5
    Registered User
    Join Date
    09-15-2015
    Location
    Malaysia
    MS-Off Ver
    Office 365
    Posts
    45

    Re: Please help - Unable to Subtract Correct Time

    Thank you for your Advise. Ravin

  6. #6
    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,384

    Re: Please help - Unable to Subtract Correct Time

    Your times are in date & time format rather than just time: is that required?

    Format cells to [h]m if you expect results > 24

    To convert time to decimal time (time in A1)

    =(A1-INT(A1))*24

  7. #7
    Registered User
    Join Date
    09-15-2015
    Location
    Malaysia
    MS-Off Ver
    Office 365
    Posts
    45

    Re: Please help - Unable to Subtract Correct Time

    Thank you For your Advise. Regards, Ravin

  8. #8
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    504

    Re: Please help - Unable to Subtract Correct Time

    hi I have amended your sheet

    Revised OT Format1.xls

    format Time in and Time out as

    00\:00
    example enter 700 this will be displayed as 7:00
    712 this will be displayed as 7:12 etc

    place the following formula in H9

    =IF(COUNT(F9,G9)=2,MAX(0,MIN(TEXT(G9,"00\:00")+(TEXT(F9,"00\:00")>TEXT(G9,"00\:00")))-MAX(TEXT(F9,"00\:00"))),"0")*24
    copy down and copy to othr Total hrs columns

    remeber it is text not real time

  9. #9
    Registered User
    Join Date
    09-15-2015
    Location
    Malaysia
    MS-Off Ver
    Office 365
    Posts
    45

    Re: Please help - Unable to Subtract Correct Time

    Thank you for you Advise. Regards, Ravin

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Please help - Unable to Subtract Correct Time

    You have just posted the same thing 3 times. Did you actually do that, or was it a forum problem?

  11. #11
    Registered User
    Join Date
    09-15-2015
    Location
    Malaysia
    MS-Off Ver
    Office 365
    Posts
    45

    Re: Please help - Unable to Subtract Correct Time

    Sorry, Wanted to thank the other guys but didn't know actually I posted the thing.

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

    Re: Please help - Unable to Subtract Correct Time

    If your problem has been resolved, could you please mark the thread as SOLVED (See "Thread Tools" at top (first) thread).

    Thank you.

+ 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: 6
    Last Post: 07-05-2022, 01:06 PM
  2. Unable to return correct data
    By GSmith8 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-14-2013, 06:27 AM
  3. correct function to find a correct time value
    By jekidi in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-06-2013, 03:17 PM
  4. Unable to pull the correct data into Line Chart.
    By LunarLights in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-19-2013, 05:44 AM
  5. Sumproduct with OR criteria, unable to properly subtract all the AND cases.
    By psytroniks in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 12-04-2012, 01:24 PM
  6. Unable to get a correct stacked column chart
    By Norskie39 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-15-2012, 05:31 AM
  7. Unable to display Correct Text with Time reference
    By sajeel in forum Excel General
    Replies: 3
    Last Post: 01-25-2011, 04:12 PM
  8. Unable to enter a (correct) vba password
    By possum in forum Excel General
    Replies: 1
    Last Post: 10-28-2009, 11:12 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