+ Reply to Thread
Results 1 to 8 of 8

Convert times to 24 hour clock

Hybrid View

  1. #1
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Convert times to 24 hour clock

    Hi
    I am having trouble converting times, i can get it to work so far but all times with a zero at the end show as 3 digit, is there a way to convert it properly please?

    thanks for any help

    D
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,930

    Re: Convert times to 24 hour clock

    What method are you using to convert these times?
    You've posted in the VBA section but the attachment has no VBA and no formulas so we have little idea of what you've tried so far.

    BSB

  3. #3
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Re: Convert times to 24 hour clock

    Hi Sorry yes i noticed that but i dont know how to move it to the general excel or delete it to start again.

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,930

    Re: Convert times to 24 hour clock

    A moderator will have to move / delete it for you.

    In the mean time, can you tell us what you've tried so far and explain your desired outcome?

    BSB

  5. #5
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Re: Convert times to 24 hour clock

    I have just used this =(IF(a1="","",IF(a1<10,a1+12,a1))), which works except any time ending in zero show as 3 digits ie 10:30 shows as 10:3

    Thanks

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

    Re: Convert times to 24 hour clock

    it seems to work but it does not give you times in excel format.. it just gives you the number 19 if time is 7.00
    you will never be able to calculate anything based on these times as 7.15 is not quarter past 7

    however if you want a quick fix for looking like time just change your formula to

    =(IF(a1="","",IF(a1<10,a1+12.0001,a1+.0001)))
    and make sure celformatting only allows 2 decimals.


    But if you want to do calculation or present properly with : instead of the decimal point you need a different formula
    what you then need to do is convert to real excel time, which means in excel time is always a fraction of 1
    f.e 0,0 = 12:00AM 0,5 is 12:00PM and 7PM is ~ 0,791666667

    this can be done with this formula

    =IF(A2<10,TRUNC(A2+12)/24,A2/24)+MOD(A2,1)*100/60/24


    see attached file also..
    Attached Files Attached Files
    Last edited by Roel Jongman; 05-06-2018 at 10:12 AM. Reason: strange textfragment removed

  7. #7
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Convert times to 24 hour clock

    Cross-posted without a link here
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  8. #8
    Registered User
    Join Date
    04-11-2012
    Location
    Stoke, England
    MS-Off Ver
    Ms 365
    Posts
    68

    Re: Convert times to 24 hour clock

    Roel Jongman

    Thank you for your help much appreciated

+ 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] 24-hour clock timesheet help
    By utahcorvettenut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-17-2015, 07:25 AM
  2. Subtracting 1 hour from 24 hour clock
    By alep002 in forum Excel General
    Replies: 7
    Last Post: 09-05-2011, 06:57 PM
  3. Default time from 12 hour clock to 24 hour clock
    By MR-77 in forum Excel General
    Replies: 3
    Last Post: 03-31-2011, 04:15 PM
  4. [SOLVED] Decimal to 24 hour clock please.
    By Max in forum Excel Formulas & Functions
    Replies: 63
    Last Post: 09-06-2005, 04:05 AM
  5. Decimal to 24 hour clock please.
    By Steved in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  6. Decimal to 24 hour clock please.
    By Steved in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  7. [SOLVED] Decimal to 24 hour clock please.
    By Steved in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 06-09-2005, 03:05 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