+ Reply to Thread
Results 1 to 14 of 14

Custom Number Format: Convert to Date (yyyy-mm-dd)

  1. #1
    Forum Contributor
    Join Date
    11-10-2011
    Location
    New York, NY
    MS-Off Ver
    MS Office: Excel 365
    Posts
    163

    Custom Number Format: Convert to Date (yyyy-mm-dd)

    Hi,

    I have a sheet w/ multiple columns that list dates. However the dates are written in the format of '6012017' (June 1st, 2017), and '11012016' (November 1st, 2016).
    This type of format seems to be 'mddyyyy' -- where the month could be 1 or 2 digits, the day is always 2 digits, and the year is always 4 digits.

    I know how I would manipulate this via a formula, but for this exercise I can't go that route.

    *** What Custom Number Format (in the 'Format Cells' dialogue box) should I input to convert all columns to to the 'YYYY-MM-DD' format? ***

    Is this possible?

    Thank you!
    Last edited by xtinct2; 10-25-2017 at 01:27 PM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    If your values are truly dates, then I would think the current format would be something like, m"0"dyyyy.
    I assume they are not entered as dates because you are asking the question and your custom format is not working?

  3. #3
    Forum Contributor
    Join Date
    11-10-2011
    Location
    New York, NY
    MS-Off Ver
    MS Office: Excel 365
    Posts
    163

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    Quote Originally Posted by davesexcel View Post
    If your values are truly dates, then I would think the current format would be something like, m"0"dyyyy.
    I assume they are not entered as dates because you are asking the question and your custom format is not working?
    correct, they're not input as dates -- is there a workaround?
    Thanks

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    Please Login or Register  to view this content.
    Try this formula with celformat 'YYYY-MM-DD'
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    Quote Originally Posted by popipipo View Post
    Please Login or Register  to view this content.
    Try this formula with celformat 'YYYY-MM-DD'
    I thought you had it. When you have 2-digit days it shows the wrong result, I was trying to find the first zero, ie: =FIND(0,A1)-1 will give you the the month integer =LEFT(A1,FIND(0,A1)-1)

  6. #6
    Forum Contributor
    Join Date
    11-10-2011
    Location
    New York, NY
    MS-Off Ver
    MS Office: Excel 365
    Posts
    163

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    i've written a formula that works -- but i'm asking whether it's possible to accomplish w/o the use of a formula (nor VBA)?

  7. #7
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    I don't think it can

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    Try Text to Columns.

    We can't test it since we haven't seen your data, but try highlighting the column that the "dates" are in and then:

    Data > Text to Columns > Next > Next > Date: MDY > Finish

    I'm not sure if this will work with inconsistent data though.

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    To be clear, you really should convert these "date" values into actual dates, not try to format them as is to look like dates.

    Simply trying to convert something to look like a date may bring issues if you plan on doing anything with the data.

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    Quote Originally Posted by xtinct2 View Post
    i've written a formula that works -- but i'm asking whether it's possible to accomplish w/o the use of a formula (nor VBA)?
    Format cannot change the value

  11. #11
    Forum Contributor
    Join Date
    11-10-2011
    Location
    New York, NY
    MS-Off Ver
    MS Office: Excel 365
    Posts
    163

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    There are vast amounts of columns with dates in these formats, so I can't use a formula b/c it'd require having a formula column for each static column.
    The result doesn't need to have propertices of a date -- just needs to be in the yyy-mm-dd format -- even if excel only recognizes it as text, that's fine.

    Doesn't see like it's possible, though
    Thanks all!

  12. #12
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    You can create a column using a formula and then copy/paste values. Then replace the original column with the actual date values.

    That way there are no additional columns and your date columns are actual dates (which you can then format however you'd like.

  13. #13
    Registered User
    Join Date
    09-16-2017
    Location
    Agra
    MS-Off Ver
    2013
    Posts
    72
    Quote Originally Posted by xtinct2 View Post
    There are vast amounts of columns with dates in these formats, so I can't use a formula b/c it'd require having a formula column for each static column.
    The result doesn't need to have propertices of a date -- just needs to be in the yyy-mm-dd format -- even if excel only recognizes it as text, that's fine.

    Doesn't see like it's possible, though
    Thanks all!
    Sorry but why you are not looking forward to vba . I saw you mentioned some where abt that.

  14. #14
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Custom Number Format: Convert to Date (yyyy-mm-dd)

    If you don't want to save the book as a macro workbook, you can have the code in a different workbook and run it from there.

+ 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. Help require to change a year format to custom yyyy-yyyy format
    By mso3 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-23-2015, 01:04 AM
  2. [SOLVED] Convert NUMBER Series entered as TEXT To DATE FORMAT mm/dd/yyyy
    By jobie804 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-05-2014, 02:38 PM
  3. [SOLVED] How to Convert date format ( DD/MM/YYYY) into MM/YYYY
    By PRADEEPB270 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-04-2014, 07:25 AM
  4. convert date in yyyy/mm/dd format
    By abraham30 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-12-2013, 05:40 AM
  5. [SOLVED] Convert date format to (dd/mm/yyyy)
    By nur2544 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-11-2013, 09:40 AM
  6. [SOLVED] Convert Date Format from yyyy-mm-dd to dd mmm yy using VBA
    By longbow007 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2012, 07:36 AM
  7. [SOLVED] Imported data contains strings dd.mm.yyyy how can I convert to date format dd/mm/yyyy inVB
    By Boormo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2012, 05:48 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