+ Reply to Thread
Results 1 to 6 of 6

Displaying time

  1. #1
    Registered User
    Join Date
    05-10-2017
    Location
    Riverside CA
    MS-Off Ver
    2016 Home
    Posts
    21

    Displaying time

    I have a cell containing a time with a custom format with type h:mm AM/PM. The cell contents are displayed as: 6:55 PM

    When a different cell refers to the above cell, the result is displayed as: 0.788194444444445

    How can I get the result to be displayed as: 6:55 PM
    Last edited by gcotterl; 07-02-2017 at 03:23 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Displaying time

    Copy the original and use Paste Special | Formats
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Displaying time

    Quote Originally Posted by gcotterl View Post
    I have a cell containing a time with a custom format with type h:mm AM/PM. The cell contents are displayed as: 6:55 PM
    When a different cell refers to the above cell, the result is displayed as: 0.788194444444445
    How can I get the result to be displayed as: 6:55 PM
    You neglect to say how the second cell "refers" to the first cell. Does the second cell have a text formula, e.g. ="Time is " & A1?

    If so, change the formula to ="Time is " & TEXT(A1,"h:mm AM/PM").

    If the second cell has a numeric formula, e.g. =A1, you might need to also format that cell as h:mm AM/PM.

    Sometimes Excel is clever enough to "copy" the format of the referenced cell. Sometimes it is not. It might also depend on some Advanced Options settings, e.g. "Extend data range formats" perhaps. In any case, I have not found this behavior ("copying" formats) to be very consistent. So I do not rely on it.

    PS.... I presume you understand that 0.788194444444445 is simply the internal representation of 6:55 PM. That is why 6:55 PM appears that way when the cell is formatted as General or Number or referenced in a text formula.

  4. #4
    Registered User
    Join Date
    05-10-2017
    Location
    Riverside CA
    MS-Off Ver
    2016 Home
    Posts
    21

    Re: Displaying time

    Thank You!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Displaying time

    0.78819444444444500 is the decimal fraction representing 6:55 PM when the cell is formatted as General and the number of decimal places is increased.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Displaying time

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Displaying data as time duration rather than time of day
    By BrookeA in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-13-2014, 06:48 PM
  2. [SOLVED] Time entry on UserForm displaying inccorectly and calculation not working on the time.
    By Colin Smit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-12-2014, 01:21 PM
  3. Displaying current time
    By Dave_ross in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2012, 09:28 AM
  4. Displaying Time
    By Corzy75 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-13-2010, 04:47 PM
  5. Displaying time from 00:00 to 0.00
    By North for Short in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 06-28-2006, 12:45 AM
  6. [SOLVED] Displaying Unix time as date and time
    By [email protected] in forum Excel General
    Replies: 1
    Last Post: 05-30-2006, 05:35 PM
  7. Displaying date/time!
    By Preet in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2005, 06:17 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