+ Reply to Thread
Results 1 to 4 of 4

Compare Dates to see if date 1 occurs before or after date 2

  1. #1
    Registered User
    Join Date
    10-10-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Compare Dates to see if date 1 occurs before or after date 2

    Hello All,

    I have Case or Incident Numbers in Column A. Column B has log created dates. Column C has log closed dates.

    End result will be the number of cases that do not have repeat logs.


    I need to find duplicate case numbers and then compare the logs. If there is not a duplicate case number, Column D needs to say No (it says original in my sample for visual purposes). If there is a duplicate case number, then it needs to look at the first log closed date and look at the duplicate log and decide if it was created before or after that activity closed. If it is before it does not meet my criteria, the log must be closed. If it is after, a simple yes or repeat would work.

    I put an array in column E to find the max date for the case number but i think VBA is going to be the way to get this done. In my sample I have included 21 lines however my data contains over 600,000 rows of data.

    I thought the max column would help me but I need it to look from the row down.

    Case 1

    1st Log Created 8/01/2009 08:00 AM Log Closed 8/01/2009 10:00 AM
    2nd Log Created 8/01/2009 11:00 AM Log Closed 8/10/2009 10:00 AM
    3rd Log Created 8/03/2009 08:00 AM Log Closed 8/05/2009 10:00 AM
    4th Log Created 8/12/2009 08:00 AM Log Closed 8/15/2009 10:00 AM

    So, first log is the original. 2nd log would be a repeat. 3rd log cannot be a repeat because the 2nd is still open. 4th log would be a repeat because the second log closed.

    Hope that is clear enough. Any help appreciated. Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Compare Dates to see if date 1 occurs before or after date 2

    Try this formula in D2, copied down:

    Please Login or Register  to view this content.
    confirmed with CTRL+SHIFT+ENTER not just ENTER


    Edit: I read your post more thoroughly and realized I hadn't included your conditions for your example above...
    Last edited by NBVC; 10-10-2009 at 10:56 PM. Reason: Fixed formula to include more conditions to be met.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-10-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Compare Dates to see if date 1 occurs before or after date 2

    it's getting closer .. i stared at it all saturday and couldn't get closer .. what condition did it not meet?
    Last edited by ashton; 10-11-2009 at 11:47 PM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Compare Dates to see if date 1 occurs before or after date 2

    You'll have to elaborate on that... where is it not working?

    Did you confirm the formula with CTRL+SHIFT+ENTER keys? Not just ENTER, so that { } brackets appeared around it... then copy down.

+ 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