+ Reply to Thread
Results 1 to 7 of 7

trouble formatting dates

  1. #1
    Forum Contributor
    Join Date
    07-16-2007
    Posts
    174

    trouble formatting dates

    i have the date as text in the format as follows:

    24 September 2008

    in cell B11.

    i want to convert this to the format 2008-9-24 in another cell (any cell will do for now!)

    i can do this, using =VALUE B11 in B12 and formatting the cell as date, but the month value is 09 and not 9, as i would like. if i use any of the text functions to remove the zero, they treat the formatted cell as '39715' and not as it displays. If there is a way to do this, i do not want it to affect the month when it is double digits (ie when the month is 11, i do not want to remove the leading zero and end up with just 1) please help!!
    Regards, jamie

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,
    Just use the custom format yyyy-m-d

    HTH

  3. #3
    Forum Contributor
    Join Date
    07-16-2007
    Posts
    174
    Thank you, perfect!

  4. #4
    Forum Contributor
    Join Date
    07-16-2007
    Posts
    174
    sorry to be a pain! how can i now convert this to a text format? the cell i want it in is a variable in a webdata update. it does not recognise the weblink if the cell sshows it in any other format than text. i need the cell to show 2008-9-24, but as text!

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    One way would be a User Defined function (UDF)

    In a VBE module enter the following Function

    Please Login or Register  to view this content.
    now in any cell type =TextDate(A5)
    assuming your date is in A5

    HTH

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    With a formula....

    =TEXT(B11,"yyyy-m-d")

  7. #7
    Forum Contributor
    Join Date
    07-16-2007
    Posts
    174
    thankyou both!

+ 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. Conditional Formatting (Expiration Dates)
    By ConsbruckR in forum Excel General
    Replies: 7
    Last Post: 09-20-2011, 10:49 AM
  2. Counting dates with Conditional Formatting
    By nee2m in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-20-2008, 07:45 AM
  3. Conditional formatting and dates
    By pingwin77 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-07-2008, 05:01 PM
  4. conditional formatting - dates
    By IanJ in forum Excel General
    Replies: 10
    Last Post: 01-07-2008, 01:53 PM
  5. Conditional formatting formulas for dates
    By oakman in forum Excel General
    Replies: 6
    Last Post: 10-31-2007, 03:13 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