+ Reply to Thread
Results 1 to 5 of 5

Custom formatting time question

  1. #1
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Custom formatting time question

    Good evening. I have a few spreadsheets that use start and end time to determine elapsed time. I use the 24 hour military format because it is instinctual for me and I don't have to explicitly type am or pm. I would also like to not have to leave the number pad to type a colon. I did a custom format that I thought would address that. It did after a fashion. If i type 13:00 the colon will disappear when I hit either enter or tab. But if I simply type 1300 it changes to 0000 when I move to the next cell. The closest I have come is that I made an autocorrect entry so I type "--" and it becomes a colon, which disappears when I move to the next cell. Can anyone suggest a different approach?

    Capture.PNG

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

    Re: Custom formatting time question

    Quote Originally Posted by Mr_Phil View Post
    ...I would also like to not have to leave the number pad to type a colon....
    doing that will enter a whole number into the cell, not a tile.

    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 formatted in a way that we recognize as a date. So, for instance, today (Sun 19 Aug 2018) is actually 43331

    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

    Seeing as you have now entered 1300 (one thousand three hundred) into the cell, no TIME formatting will change that
    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
    Forum Contributor
    Join Date
    03-08-2011
    Location
    Lubbock, TX, USA
    MS-Off Ver
    MS OFFICE 365 EXCEL, OUTLOOK, WORD, POWERPOINT
    Posts
    194

    Re: Custom formatting time question

    I did more research and came up with the same conclusion. It is what it is. Oh well. The autocorrect for a double minus sign will allow me to keep up the pace of the data entry without too big a problem. Thanks for reading and providing some insight.

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

    Re: Custom formatting time question

    If you have a column (L) for times, you can custom format it with 00\:00 to show 13:00 when you type in 1 3 0 0 (or just leave it as is without the custom format). But, to calculate with the entry as a time, you will use a (hidden) helper column (M) with the formula: =TIME(INT(L1/100),MOD(L1,100),0)
    Ben Van Johnson

  5. #5
    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,936

    Re: Custom formatting time question

    Thanks for the feedback

+ 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. Custom Button > E-mail. Hyperlink and text formatting question.
    By MiGGsHz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-25-2014, 11:40 PM
  2. Custom Formatting of Time
    By springboardjg in forum Excel General
    Replies: 4
    Last Post: 05-30-2012, 04:35 AM
  3. custom formatting question (easy?)
    By shams in forum Excel General
    Replies: 2
    Last Post: 06-30-2008, 07:50 PM
  4. Custom formatting question
    By yd37 in forum Excel General
    Replies: 1
    Last Post: 10-16-2007, 11:57 AM
  5. A question on Custom Formatting
    By arad in forum Excel General
    Replies: 1
    Last Post: 12-30-2006, 07:24 PM
  6. [SOLVED] Custom Formatting numbers question
    By Junkyard Engineer in forum Excel General
    Replies: 2
    Last Post: 07-14-2005, 04:05 PM

Tags for this Thread

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