+ Reply to Thread
Results 1 to 15 of 15

Comparing a list of dates to check they match

  1. #1
    Registered User
    Join Date
    02-08-2005
    Location
    Kent, UK
    MS-Off Ver
    2010
    Posts
    69

    Question Comparing a list of dates to check they match

    I have one list of four dates and in theory they should match but I'd like to have some conditional formatting to highlight when they don't match. It's complicated by the fact that the formula neesd to ignore any cells in the list that are blank. The mismatch could be any of the 4 dates. MATCH doesn't appear to be quite what I'm after as that needs two lists.

    Any ideas? I can only think of a very long IF formula to check the cells one by one.
    Last edited by koltregaskes; 05-28-2012 at 04:34 AM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Comparing a list of dates to check they match

    Hello
    If I understand you correctly, you want to conditionally format a column of dates that don't match your list of 4 dates and also ignore any blank cells in the column. If so try the following conditonal formatting formula:

    =AND(A2<>"",ISNA(MATCH(A2,$F$2:$F$5,0)))

    Here your column of dates would begin in A2 to A? and your list of 4 dates is situated in cells F2:F5.

    Hope this is what you're looking for.
    DBY

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

    Re: Comparing a list of dates to check they match

    hi koltrgaskes, how do u define a mismatch? if the 4 dates are in A1:D4, 3 dates are the same & 1 is different, is the 1 a mismatch? What if it's 2 sets of dates? which will be a mismatch? maybe u can upload a file & show which is a mismatch

    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

  4. #4
    Registered User
    Join Date
    02-08-2005
    Location
    Kent, UK
    MS-Off Ver
    2010
    Posts
    69

    Re: Comparing a list of dates to check they match

    DBY,

    Thanks for the quick reply. No not quite. There is no second list and I'm not looking up against anything else apart from the one list of 4 dates.

  5. #5
    Registered User
    Join Date
    02-08-2005
    Location
    Kent, UK
    MS-Off Ver
    2010
    Posts
    69

    Re: Comparing a list of dates to check they match

    benishiryo,

    Again, thanks for teh quick reply. A mismatch is defined as any type of mismatch not including blanks. If any one date differs than I'd like it highlighted via conditional formatting. If 1 cell is blank and 3 have the same date then that's fine. If one date is different in the 3 cells then that's a mismatch. In theoy all dates should be exactly the same unless there is no date.

    If there is a mismatch we need to update our client's systems so they do match.

  6. #6
    Registered User
    Join Date
    02-08-2005
    Location
    Kent, UK
    MS-Off Ver
    2010
    Posts
    69

    Re: Comparing a list of dates to check they match

    Basically if all 4 dates minus blanks match then that is correct. All other scenarios, ignoring blanks, is a mismatch.

  7. #7
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Comparing a list of dates to check they match

    Hi
    The following conditional formula will highlight a date if it does not match the other 3. But this assumes only 1 date out of the 4 is incorrect. It ignores blanks.

    =AND(A1<>"",COUNTIF($A$1:$A$4,A1)=1)

    Here your list would be in A1:A4.

    DBY

  8. #8
    Registered User
    Join Date
    02-08-2005
    Location
    Kent, UK
    MS-Off Ver
    2010
    Posts
    69

    Re: Comparing a list of dates to check they match

    No worries, thanks. Looks like I'll be writing a long IF statement to do what I need. :-)

  9. #9
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Comparing a list of dates to check they match

    Hi

    Sorry it's not working for you. I was working with what you said here:

    If any one date differs than I'd like it highlighted via conditional formatting.
    The conditional formula I gave does highlight any one date that differs.

    What happens if it's a 50/50 split of the 4 dates, 2 of each. What gets highlighted?

  10. #10
    Registered User
    Join Date
    02-08-2005
    Location
    Kent, UK
    MS-Off Ver
    2010
    Posts
    69

    Re: Comparing a list of dates to check they match

    Apoligses, should have said I'd like the header to be highlighted, so A1 would be the header and A2:A5 would be the dates. I can't highlight the individual cells as like you say I wouldn't know what date is the wrong one, two or three. It will be a highlighted on the header then we can see there is a mismatch on that milestone and investigate further and correct it.

  11. #11
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Comparing a list of dates to check they match

    Hi
    It's becoming a bit clearer. If you just wish to highlight the header, then try the following conditional formatting formula in cell A1, if your list is in A2:A5.

    Please Login or Register  to view this content.
    This seems to work for me, but test it out. Fingers crossed.

    DBY

  12. #12
    Registered User
    Join Date
    02-08-2005
    Location
    Kent, UK
    MS-Off Ver
    2010
    Posts
    69

    Re: Comparing a list of dates to check they match

    Thank you. I think we're getting a little closer. :-)

    What it doesn't seem to do is ignore blanks? What seems to happen is if I have 2 blanks the conditional formatting is not activating regardless of a mismatch or not. If I have 1, 3 or 4 blanks the conditional formatting does kick in, again regardless of a mismatch. Obviously 3 or 4 blanks is not an error. If I have 4 dates then the formula works a treat with any combo of mismatch.

  13. #13
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Lightbulb Re: Comparing a list of dates to check they match

    Hi
    Sorry I couldn't get back yesterday but for some reason I couldn't get the forum to load. Other web pages were fine, very strange. However, yes, the formula I provided was not very good, so try this new one, it seems to be working better.

    Please Login or Register  to view this content.
    Hope we're getting closer it's a logic problem and my brain doesn't want to compute!

    DBY

  14. #14
    Registered User
    Join Date
    02-08-2005
    Location
    Kent, UK
    MS-Off Ver
    2010
    Posts
    69

    Talking Re: Comparing a list of dates to check they match

    Not a problem at all, DBY. Just glad someone has replied. :-)

    And I think you've cracked it. Yeah, my logic only goes so way. ;-)

    Thank you very much for your help! Solved.

  15. #15
    Registered User
    Join Date
    02-08-2005
    Location
    Kent, UK
    MS-Off Ver
    2010
    Posts
    69

    Re: Comparing a list of dates to check they match

    For bonus points I was wondering if someone could check me here. The 4 dates relate to 4 "sites". These 4 sites have site refs (which appear on the same tab in a similar block of 4 cells. I'd like the conditional formatting to only activate when these site refs match. Does this formula look correct if we assume the 4 refs are in A2:A5 and the dates are in B2:B5?

    Please Login or Register  to view this content.
    The complication comes when we have a mixture of matching and mismatching site refs but that's going to be too complex so I'm happy with the above formula that checks for matching refs or not if no one can see any potential problems?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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