+ Reply to Thread
Results 1 to 3 of 3

Formating custom dates and comparing dates with different formats

  1. #1
    Registered User
    Join Date
    03-22-2012
    Location
    M, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    45

    Formating custom dates and comparing dates with different formats

    I have two "date" columns in my spreadsheet, and my goal is to compare the two dates for each record and flag those that are not equal:
    =if(A1=B1, 0, 1). The problem is that the formats of the "date" columns are different, and Excel does not appear to recognize one of those columns as dates.

    Specifically:

    Column A: The format is dd-mmm-yy, and Excel seems to recognize these as dates because, when I click on a cell, it is displayed above as m/dd/yyyy.

    Column B: The format for these cells was General, initially. I attempted to change this to a date format by selecting those cells --> Format Cells --> Custom --> then entered yyyymmdd, as this is the way that the date is represented in this field. However, Excel still does not seem to recognize these as dates, because when clicking on those cells, they are not displayed above as m/dd/yyyy. And the If formula noted above does not give correct results: It will indicate that two dates are different, when they are not.

    What must be done in order in order correctly represent the cells in Column B as dates so that they can be compared to the cells in Column A?

    Thank you!!!

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Formating custom dates and comparing dates with different formats

    hi OmniBlue. could you select the both column A & B, then press CTRL + SHIFT + ~
    you should see all of them become numbers if they are real dates. Undo it to revert to normal. if they are all numbers, you can simply right-click & format cells to whatever format you want

    if they are not, select the range which are not recognized (i guess it's column B). go to Data -> Text to Column -> Delimited -> Next -> Next -> Date: ymd -> Finish. you can formatting of cells mentioned or compare.

    if you want to do a formula to compare directly, try:
    =IF(A1=--TEXT(B1,"00-00-00"),1,0)
    or just:
    =--(A1=--TEXT(B1,"00-00-00"))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    03-22-2012
    Location
    M, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Formating custom dates and comparing dates with different formats

    Thank you so much, benishiryo! Your solution worked perfectly!

+ 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] Auto filling dates based on previously entered dates and averaging numbers if dates equal
    By grambograham in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2012, 03:21 PM
  2. Condition formating on due dates between a row of dates
    By irismarcial in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-11-2012, 04:18 PM
  3. Replies: 5
    Last Post: 06-30-2011, 03:26 PM
  4. Replies: 1
    Last Post: 05-27-2010, 12:32 PM
  5. Install dates formating using conditional formating?
    By Jerry Eggleston in forum Excel General
    Replies: 2
    Last Post: 11-09-2005, 01:49 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