+ Reply to Thread
Results 1 to 5 of 5

Struggling to display the time properly in a formula

  1. #1
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Struggling to display the time properly in a formula

    Hi I have a formula and I looking to add the time onto the end of it.

    The formula is

    =TEXT(D49,"dddd ")&DAY(D49)&LOOKUP(DAY(D49),{1,2,3,4,21,22,23,24,31;"st","nd","rd","th","st","nd","rd","th","st"})&" of "&TEXT(D49,"mmmm yyyy")&" @ "&D47

    D49 is the date and D47 is the time


    the result at the moment is

    Wednesday 1st of July 2015 @ 0.458333333333333

    the result should be

    Wednesday 1st of July 2015 @ 11.00am

    Cheers in advance

    John

  2. #2
    Registered User
    Join Date
    01-28-2014
    Location
    Brno
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Struggling to display the time properly in a formula

    Hi John,

    Maybe something like this:

    =TEXT(D49,"dddd ")&DAY(D49)&LOOKUP(DAY(D49),{1,2,3,4,21,22,23,24,31;"st","nd","rd","th","st","nd","rd","th","st"})&" of "&TEXT(D49,"mmmm yyyy")&" @ "&TEXT(D47,"hh:mm")

  3. #3
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Struggling to display the time properly in a formula

    Cheers

    How do you get the am or pm part ?

    John

  4. #4
    Registered User
    Join Date
    01-28-2014
    Location
    Brno
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Struggling to display the time properly in a formula

    Right, I forgot this part.. Change the last part of your formula to: TEXT(D47,"hh:mm AM/PM")

  5. #5
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Struggling to display the time properly in a formula

    Cheers pepe that works a treat mate.

    John

+ 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. Struggling to use pivot table to display text
    By DThorpe in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 01-08-2014, 07:41 AM
  2. Date Does Not Display Properly
    By ditee26 in forum Excel General
    Replies: 1
    Last Post: 05-06-2013, 11:41 AM
  3. B5 uses VBA Code. How to properly display info in B5 into AB5?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-19-2010, 01:54 PM
  4. Graph does not display properly
    By ravichander in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 01-31-2009, 02:26 PM
  5. Getting a formula to Evaluate Time Properly
    By tehmole in forum Excel General
    Replies: 7
    Last Post: 08-22-2008, 01:32 PM
  6. Struggling with TIME calculations ...
    By Greggy in forum Excel General
    Replies: 10
    Last Post: 02-03-2006, 05:00 PM
  7. Replies: 2
    Last Post: 07-22-2005, 09:05 PM
  8. [SOLVED] Word Wrap does not seem to display properly
    By news.microsoft.com in forum Excel General
    Replies: 1
    Last Post: 03-21-2005, 07:06 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