+ Reply to Thread
Results 1 to 15 of 15

having problems changing the date format

  1. #1
    Registered User
    Join Date
    12-18-2015
    Location
    singapore
    MS-Off Ver
    excel 2010
    Posts
    6

    having problems changing the date format

    Hi All,

    i'm currently trying to convert 12/18/2015 into 2015-12-18 using the text() formula.

    currently cell DI73 is populated with 12/18/2015
    1. therefore i use the formula, =TEXT(DI73,"yyyy-mm-dd") but i still get 12/18/2015.

    2. i also tried changing the format manually as shown in the attachment, but still unable to change the format.

    date issue.png

    3. i also ensured that the computer date format is also in yyyy-mm-dd format, but still nothing works.

    i am really stuck here.

  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,411

    Re: having problems changing the date format

    If you format cell D173 as General, what happens? Does it change to a numeric value, or does it stay the same? If it changes to a number, it is a date and should respond to date formatting. If it doesn't, it is a text value that just looks like a date and won't be affected by formatting or using TEXT().


    Regards, TMS
    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 shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: having problems changing the date format

    Once try to select the whole column where dates are mentioned then CTRL+H -> find "/" and Replace with "-".
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  4. #4
    Registered User
    Join Date
    12-18-2015
    Location
    singapore
    MS-Off Ver
    excel 2010
    Posts
    6

    Re: having problems changing the date format

    Quote Originally Posted by shukla.ankur281190 View Post
    Once try to select the whole column where dates are mentioned then CTRL+H -> find "/" and Replace with "-".
    but i want to put the year in front. replacing only solves the problem halfway.

  5. #5
    Registered User
    Join Date
    12-18-2015
    Location
    singapore
    MS-Off Ver
    excel 2010
    Posts
    6

    Re: having problems changing the date format

    Quote Originally Posted by TMS View Post
    If you format cell D173 as General, what happens? Does it change to a numeric value, or does it stay the same? If it changes to a number, it is a date and should respond to date formatting. If it doesn't, it is a text value that just looks like a date and won't be affected by formatting or using TEXT().


    Regards, TMS
    Thanks for the highlight. but how do i convert the text to a date format? i tried datevalue and date. nothing seems to work.

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: having problems changing the date format

    Try
    E173=RIGHT(D173,4)&"-"&IF(LEN(D173)>=10,LEFT(D173,2),"0"&LEFT(D173,1))&"-"&IF(LEN(D173)>=10,MID(D173,FIND("/",D173)+1,2),"0"&MID(D173,FIND("/",D173)+1,1))

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-18-2015
    Location
    singapore
    MS-Off Ver
    excel 2010
    Posts
    6

    Re: having problems changing the date format

    Quote Originally Posted by shukla.ankur281190 View Post
    Try
    E173=RIGHT(D173,4)&"-"&IF(LEN(D173)>=10,LEFT(D173,2),"0"&LEFT(D173,1))&"-"&IF(LEN(D173)>=10,MID(D173,FIND("/",D173)+1,2),"0"&MID(D173,FIND("/",D173)+1,1))

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    thanks man. but i'm trying to replace all dates with the new format in its own cell. if it were in a different cell i would have used your method as well. should i be using a macro for this?

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: having problems changing the date format

    Quote Originally Posted by oto45 View Post
    Thanks for the highlight. but how do i convert the text to a date format? i tried datevalue and date. nothing seems to work.
    Select the "date" - Data ribbon - Click "Text to columns" then Finish. Normally you now have a real date. Now format as wanted

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: having problems changing the date format

    And please Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.

  10. #10
    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,411

    Re: having problems changing the date format

    Pepe beat me to the suggestion to use Text to Columns. Once you have done that you can use whatever custom format you wish.

    Regards, TMS

  11. #11
    Registered User
    Join Date
    12-18-2015
    Location
    singapore
    MS-Off Ver
    excel 2010
    Posts
    6

    Re: having problems changing the date format

    Hi Guys,

    sorry i forgot to mention that i tried the text to columns method before i even started this thread. didn't work.

    the issue is like what TMS mentioned. the date is actually "a text value that just looks like a date and won't be affected by formatting or using TEXT()." therefore text to column wouldn't work. i tried converting the date using different formatting, nothing changed. i think this is due to the fact that excel is unable to detect a date with the slash format. i guess the way to solve this is to ensure the excel detects a date in the particular cell. any ideas?

    it wouldn't be a problem if its just one column, but i have like hundreds of columns to convert and its virtually impossible to do it manually like what shukla.ankur281190 suggested.
    Last edited by oto45; 12-21-2015 at 04:35 AM.

  12. #12
    Registered User
    Join Date
    02-20-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: having problems changing the date format

    Hi,

    Try if this formula works for you

    =TEXT(DATE(VALUE(RIGHT(TEXT(LEFT(D173,10),"dd/mm/yyyy"),4)),VALUE(LEFT(TEXT(LEFT(D173,10),"dd/mm/yyyy"),FIND("/",TEXT(LEFT(D173,10),"dd/mm/yyyy"))-1)),VALUE(MID(TEXT(LEFT(D173,10),"dd/mm/yyyy"),FIND("/",TEXT(LEFT(D173,10),"dd/mm/yyyy"))+1,2))),"yyyy-mm-dd")

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: having problems changing the date format

    Text-to-columns will work

    Custom format your column to YYYY-MM-DD.

    Text-To-Columns

    In Step 3

    Choose Date

    Format MDY

    Finish

    It will show as "dd/mm/yyyy" in formula bar but as "yyyy-mm-dd" in the column cells

  14. #14
    Registered User
    Join Date
    12-18-2015
    Location
    singapore
    MS-Off Ver
    excel 2010
    Posts
    6

    Re: having problems changing the date format

    Hi JohnTopley,

    Yup, tried the text to column thing, it changed it into 3 cell columns. but the question is how do i convert it and maintain a single cell? i do not want it to split into 3 columns. and also the date value is wrong in each column. sorry i'm new to this text to column function.

    2015-12-22 4-17-17 PM.png

    Hi NinadM,

    i tried the formula and it worked just fine. but how do i replace each text with your formula for the entire worksheet which contains hundreds of rows and columns? i do not want to create a new column beside it to place the formula into. any ideas?

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: having problems changing the date format

    It should only be ONE column: just go straight to Step 3 in Text-_to-Columns (ignore steps 1 and 2)

    Post a file NOT image: we cannot work with an image

+ 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. Convert Date and Time to Date - Format problems
    By eugbed in forum Excel General
    Replies: 5
    Last Post: 05-03-2015, 05:31 PM
  2. [SOLVED] Problems with changing date format
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-19-2014, 10:50 AM
  3. [SOLVED] Problems with date format
    By h0ps in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-04-2012, 09:50 AM
  4. VBA Date Format Problems
    By Adam Smith in forum Excel General
    Replies: 3
    Last Post: 04-20-2010, 08:37 AM
  5. More date format problems
    By Joe Hardey in forum Excel General
    Replies: 2
    Last Post: 12-07-2006, 03:07 PM
  6. [SOLVED] Date format problems ...
    By budgie in forum Excel General
    Replies: 6
    Last Post: 02-20-2006, 08:40 AM
  7. Date Format Problems??
    By nastech in forum Excel General
    Replies: 5
    Last Post: 11-13-2005, 10:00 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