+ Reply to Thread
Results 1 to 11 of 11

Dates are not in the same format even though both cells are formated as "DATE"

  1. #1
    Registered User
    Join Date
    10-17-2013
    Location
    Danmark
    MS-Off Ver
    Excel 2010
    Posts
    11

    Dates are not in the same format even though both cells are formated as "DATE"

    I'm working with a big dataset and the dates come out in this way:

    94WAO7t.png

    How can I fix this?

    EDIT: Example of book included
    Attached Files Attached Files
    Last edited by The Mathguy; 10-17-2013 at 02:30 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    Hi and welcome to the forum

    Please do not upload a picture of your file...rather, upload a sample of your workbook, showing what data you are working with, a few samples of your expected outcome is (manually entered is ok) and how you arrived at that. (exclude sensitive info). Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you Also, not all members can upload picture files (Company firewalls and stuff)

    I suspect that the 1's that dont come out "right" are text that just looks like a date. Formatting has no affect on the actual contents of a cell, just its appearance. Test using =ISNUMBER(cell-ref) FALSE indicates text

    Let me know if this is the problem, then we can take the next step
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    Some of those dates are text values and others are dates, but probably with the month and date transposed. How would you normally format a date in Denmark - is it dd/mm/yyyy or mm/dd/yyyy?

    It might be better to post an example workbook rather than a picture of one. Then we can try out different formulae for you.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    10-17-2013
    Location
    Danmark
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    The dataset is put together from different stand-alone sources where the format is mm/dd/yyyy but it would be nice to have it converted into the Danish date format dd/mm/yyyy.

    Here is an example of the dates and the formats

    http://www.docdroid.net/5abv/datetest.xlsx.html

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    You can attach a file directly to a post in this Forum - here's how:

    While you are editing a reply, you can click on Go Advanced in the bottom-right corner of the edit window and then scroll down to Manage Attachments and click on this. Then click Add Files, Select files, and navigate to your file through your folder structure and double-click its icon, then click Upload files and then Done, and then when you have finished editing your post just click Submit Post.

    Hope this helps.

    Pete

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    click on the column with dates Go to DATA, Text to columns next, next select Date and click Finish
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  7. #7
    Registered User
    Join Date
    10-17-2013
    Location
    Danmark
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    I've included an example of my book in the original post.

    The command ISTEXT returns that the dates which are to the left in the cells (first and last dates of book) are in the text-format while the dates which are to the right are not text

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    Just follow the procedure in described in my post and this will fix the problem.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    AlKey's suggestion will convert them for you, highlight the entire range (even the real dates)

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    Alkey, & FD:

    No, that only works for you because the dates were originally in US format.

    Mathguy:

    Put this formula in B1:

    =IF(ISNUMBER(A1),DATE(YEAR(A1),DAY(A1),MONTH(A1)),DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,4,2)))

    format as a date in the style your prefer, then copy down. You can fix the values and then delete column A.

    Hope this helps.

    Pete

  11. #11
    Registered User
    Join Date
    10-17-2013
    Location
    Danmark
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Dates are not in the same format even though both cells are formated as "DATE"

    That worked! Thank you so much

+ 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. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  2. Replies: 3
    Last Post: 08-13-2013, 06:25 AM
  3. Date format of just "st" "nd" "rd" and "th" with text included
    By notrandom in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2013, 05:45 PM
  4. [SOLVED] Conditionally format dates for "This week" AND "This month"?
    By Vermilion in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2012, 09:20 AM
  5. Replies: 5
    Last Post: 07-05-2006, 02:15 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