+ Reply to Thread
Results 1 to 8 of 8

Dates with a th as Superscript

  1. #1
    Registered User
    Join Date
    06-08-2009
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    73

    Dates with a th as Superscript

    Hello All,

    Does anyone know of a way to format a dates with the st nd rd th added after the day as a superscript for example 19th July 2010

    I've tried googling and searching here but no joy.

    Idealy I'd like to create a function that does this as I use dates all the time.

    Thanks in advance

    David
    Last edited by gtbear; 07-21-2010 at 10:10 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Dates with a th as Superscript

    See http://www.excelforum.com/tips-and-t...-nd-rd-th.html.

    However, I suggest you resist the urge; the result will be text, useless for downstream calculation.
    Last edited by shg; 07-19-2010 at 11:48 AM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Dates with a th as Superscript

    How about a worksheet_change macro using Case to determine how to custom format the cell (mmm d"st" yy or mmm d"nd" yy etc)? This will allow you to continue to work with the dates as numbers.

    Here's some code that should work. Insert it into your worksheet code
    Please Login or Register  to view this content.
    Does this work for you?
    Last edited by ChemistB; 07-19-2010 at 01:24 PM. Reason: Added code
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    06-08-2009
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    73

    Re: Dates with a th as Superscript

    Thanks for the replies, both work well and it's almost there, but I was hoping to get the st,nd,rd as superscript

    Regards

    David

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Dates with a th as Superscript

    As far as I know that is not possible unless you convert the value from date to text.
    Everyone who confuses correlation and causation ends up dead.

  6. #6
    Registered User
    Join Date
    06-08-2009
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    73

    Re: Dates with a th as Superscript

    Text is fine as I'm using the dates for a mail merge to word and the superscript would match the Word format for dates.
    Last edited by gtbear; 07-20-2010 at 11:33 AM.

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,056

    Re: Dates with a th as Superscript

    You could use something like this:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-08-2009
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    73

    Re: Dates with a th as Superscript

    Perfect, Thank You

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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