+ Reply to Thread
Results 1 to 10 of 10

(####) = (HH:MM) in 24 Hour Clock help, thanks

  1. #1
    Registered User
    Join Date
    08-24-2007
    Location
    Florida
    Posts
    37

    (####) = (HH:MM) in 24 Hour Clock help, thanks

    Hello Excel Pro's! This may be a remedial answer, but I can't find what I'm looking for. This may be because I don't know what the proper term is.
    I'd like to place a value of, lets say 11:00am, but on my keyboard, I don't want to type the ( and/or (am). So I'd like to type (1100) and have the sheet automatically know that the input is 11:00am and for it to look like = 11:00
    This is because I'm working with a 24hour clock, so no need for am or pm.
    Then I need the formula to calculate the total time. 11:00 to 12:00 = one hour (01:00) then *24 = 1.0 (all decimals rounded to 1 decimal, ie .0-.9; 1.2 or 4.7)

    Same would go for a date. Entered = 32018 but the computer would see it as 03/20/2018 and it would look like 20-Mar-18.

    Row 1: Example
    Entered into A1 = 1100 but looks like 11:00
    Entered into B1 = 1200 but looks like 12:00
    C1 = A1 + B1 or B1 - A1 = 01:00
    D1 = C1 * 24 = 1.0

    Row 2: Example
    Entered into A2 = 1215 but looks like 12:15
    Entered into B2 = 1512 but looks like 15:12
    C2 = A2 + B2 or B2 - A2 = 02:57
    D2 = C2 * 24 = 3.0

    The tricky part is when the clock rolls over into the next day as example row 3
    Row 3: Example
    Entered into A3 = 2345 but looks like 23:45
    Entered into B3 = 0143 but looks like 01:43
    C3 = A3 + B3 or B3 - A3 = 01:58
    D3 = C3 * 24 = 2.0

    Row 4 = formulas?

    0 a b c d
    1 11:00 12:00 01:00 1.0
    2 12:15 15:12 02:57 3.0
    3 23:45 01:43 01:58 2.0
    4 =hh:mm or ##\:## =hh:mm or ##\:## Solved! =B3+--(B3<A3)-A3 =C*24

    For the date input 4418 = 4-Apr-18 not solved yet.

    Thanks for any help in advance.
    Last edited by Tdub; 06-20-2018 at 05:05 PM.

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

    Re: (####) = (HH:MM) in 24 Hour Clock help, thanks

    you run into trouble because time is always a fraction of 1. and negative times cannot be calculated to solve try this formula

    B3+--(B3<A3)-A3

    the (B3<A3) will be a true or false test and the -- will convert true to 1 and false to 0

    thus B3 will always be larger then A3 by adding 1 if it is not by itself. and the outcome will always be a valid time/duration

  3. #3
    Registered User
    Join Date
    08-24-2007
    Location
    Florida
    Posts
    37

    Re: (####) = (HH:MM) in 24 Hour Clock help, thanks

    That seems like it works pretty good and that way if there's no value entered it will just equal 0.
    So the next part would be the inputs.
    How do I make it where I can enter in 2345 and have it look like 23:45 and the sheet knows it's that time of 23:45 or 11:45pm in HH:MM format?
    I have a number keypad, and it's a pain to reach back over and type Shift : every time.
    Same for the date thing. Entered = 3202018 but the computer would see it as 03/20/2018 and it would look like 20-Mar-18.

    formating it in HH:MM or [H]:mm is not working.

    Thanks!
    Last edited by Tdub; 06-20-2018 at 03:47 PM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,602

    Re: (####) = (HH:MM) in 24 Hour Clock help, thanks

    custom format A1 & B1: ##\:##
    Total time:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by protonLeah; 06-20-2018 at 05:19 PM.
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    08-24-2007
    Location
    Florida
    Posts
    37

    Re: (####) = (HH:MM) in 24 Hour Clock help, thanks

    Custom format ##\:## worked for entering but the the new formula calculations are either now wrong or #value!
    It also now displays a big boarder around the box which I do not want.

    B3+--(B3<A3)-A3 worked previously manually typing the : symbol in the time.

    But now there's a new problem with the *24 to get the decimal not being correct.

    there are times where the decimals are .1 off.
    Last edited by Tdub; 06-20-2018 at 04:36 PM.

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

    Re: (####) = (HH:MM) in 24 Hour Clock help, thanks

    when you use the formatting option of protonleah, then you must also use his formula. because you are no longer entering times but just normal numbers and make them look like time with a formatting trick, my formula does not work anymore then.

  7. #7
    Registered User
    Join Date
    08-24-2007
    Location
    Florida
    Posts
    37

    Re: (####) = (HH:MM) in 24 Hour Clock help, thanks

    But the formula is not working for some reason and has changed the cell to have a boarder.
    I like Roel's method but need a way to do this same thing without entering the : symbol.
    Then I need the decimals to calculate correctly with *24

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,602

    Re: (####) = (HH:MM) in 24 Hour Clock help, thanks

    attachment added to post #4

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,602

    Re: (####) = (HH:MM) in 24 Hour Clock help, thanks

    1:
    running into an issue where the number is rounding to the nearest hour.
    example
    start 16:00, end 19:23=03:23
    the formula is solving 03:00
    When I put those numbers in my wb, I get 3:23 not 03:00
    2:
    Also, instead of the month number I need to month name abbreviated. April = Apr
    not the number Apr = 4
    Is there a way to tell it 1 = Jan... 4 = Apr and so on?
    No, you can't do that with custom formats. It only modifies the appearance of the date data by adding the "-" between the numbers
    Last edited by protonLeah; 06-20-2018 at 09:11 PM.

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

    Re: (####) = (HH:MM) in 24 Hour Clock help, thanks

    you cannot use my solution in combination with *24 because 2345 is not a valid time reference and calculations will give wrong results as decimal system works with 100 parts and time with 60.

    the outcome of my formula with *24 would be 2515-2345 = 170 in time 1:70 true difference is 1:30, so you need to use a more complicated formula where the decimal is changed to time

+ 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. [SOLVED] Optimize Well's with 24 hour clock
    By acode in forum Excel General
    Replies: 3
    Last Post: 05-20-2013, 02:41 AM
  3. Subtracting 1 hour from 24 hour clock
    By alep002 in forum Excel General
    Replies: 7
    Last Post: 09-05-2011, 06:57 PM
  4. 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
  5. [SOLVED] Decimal to 24 hour clock please.
    By Max in forum Excel Formulas & Functions
    Replies: 84
    Last Post: 09-06-2005, 07:05 AM
  6. Decimal to 24 hour clock please.
    By Max in forum Excel Formulas & Functions
    Replies: 63
    Last Post: 09-06-2005, 04:05 AM
  7. Decimal to 24 hour clock please.
    By Steved in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11: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