+ Reply to Thread
Results 1 to 12 of 12

how can i convert data to date format

  1. #1
    Forum Contributor
    Join Date
    03-11-2009
    Location
    duke's
    MS-Off Ver
    Excel 2007
    Posts
    112

    how can i convert data to date format

    Deal all,

    from long time i am faceing a problem to convert some data to date.

    please have a look in my attachment. there i like to conver B columon to Date format how can i change.
    Attached Files Attached Files
    " Jai ho"

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: how can i convert data to date format

    In an adjacent cell, type =datevalue(b2). This will give you the numerical value for b2. Now highlight b2 and select format. Select the type of date formatting you want. Copy B2 down. At this point you can either hide column b or replace it with the values in column C by highlighting column C. Copy-->Paste Special-->Values into column b. Then delete column C.

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    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,447

    Re: how can i convert data to date format

    It looks as though you have American format dates. Excel is taking exception to "dates" that have a month greater than 12 and doesn't try to convert them. Sadly, where it thinks a date does look OK it does convert it but the assumption is that the day and the month are the wrong way around.

    Try this in cell C2 and drag down:

    HTML Code: 

    Regards
    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


  4. #4
    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,447

    Re: how can i convert data to date format

    @Alan: I don't think it will; at least, it doesn't for me. I get #VALUE!

    Regards

  5. #5
    Forum Contributor
    Join Date
    03-11-2009
    Location
    duke's
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: how can i convert data to date format

    Quote Originally Posted by alansidman View Post
    In an adjacent cell, type =datevalue(b2). This will give you the numerical value for b2. Now highlight b2 and select format. Select the type of date formatting you want. Copy B2 down. At this point you can either hide column b or replace it with the values in column C by highlighting column C. Copy-->Paste Special-->Values into column b. Then delete column C.

    Alan
    Thank You.

    I did as u said..but i am getting Value Error some cell. now i attached tat one also..plz a have a look and do let me knw...how can i solove..
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    03-11-2009
    Location
    duke's
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: how can i convert data to date format

    Quote Originally Posted by TMShucks View Post
    It looks as though you have American format dates. Excel is taking exception to "dates" that have a month greater than 12 and doesn't try to convert them. Sadly, where it thinks a date does look OK it does convert it but the assumption is that the day and the month are the wrong way around.

    Try this in cell C2 and drag down:

    HTML Code: 

    Regards
    even i tried this also.....but its showing error #VALUE!

  7. #7
    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,447

    Re: how can i convert data to date format

    See the copy of your file with the dates converted. Maybe you can see how this works.

    Regards
    Attached Files Attached Files

  8. #8
    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,447

    Re: how can i convert data to date format

    @raveepoojari:

    I think that the problem is that I am seeing your data as presented in Excel 2003 in the UK and Alan is seeing your data as presented in the USA (Excel 2007?) so our solutions will depend on our locale.

    Basically, some of the "dates" in the column will be "real" dates, that is, numbers and others will be text that look like dates. You need to differntiate between the two and take appropriate action.

    Regards

  9. #9
    Forum Contributor
    Join Date
    03-11-2009
    Location
    duke's
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: how can i convert data to date format

    Quote Originally Posted by TMShucks View Post
    @raveepoojari:

    I think that the problem is that I am seeing your data as presented in Excel 2003 in the UK and Alan is seeing your data as presented in the USA (Excel 2007?) so our solutions will depend on our locale.

    Basically, some of the "dates" in the column will be "real" dates, that is, numbers and others will be text that look like dates. You need to differntiate between the two and take appropriate action.

    Regards
    Ur right....becoz i m using excel-2003 at ofc and using excel-2007 at home.
    now wat can i do...?

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: how can i convert data to date format

    @TMShucks. Exactly what I am seeing. Locale will be a factor.

  11. #11
    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,447

    Re: how can i convert data to date format

    @raveepoojari:

    The version of Excel that you are using shouldn't make a difference.

    As a test, select all the data in column B. Format all the cells as General. If the "date" still "looks like a date", it's text, not really a date. If the cell has a number in it, that's a real date ... but it might have the day and the month the wrong way around ... admittedly, that's a guess based on the way I'm seeing your data here.

    However, you do need to be sure that you get it right as it means the difference between 1st September and the 9th January. In my world, that looks like 01/09/2010 (dd/mm/yy) and 09/01/2010.

    So, first check what you've got. Then do something to convert it. I think you should be able to use my formula as an example.

    Regards

  12. #12
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: how can i convert data to date format

    Interestingly enough, I received a newsletter today from Francis Hayes ("The Excel Addict") and he covered this very issue. He had an interesting approach that works. I have attached for any that are interested in his solution.
    Attached Files Attached Files

+ 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