+ Reply to Thread
Results 1 to 4 of 4

Indicate Duplicate with Small Time Span? (ID#, Start Date, Stop Date columns)

  1. #1
    Registered User
    Join Date
    06-13-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    63

    Indicate Duplicate with Small Time Span? (ID#, Start Date, Stop Date columns)

    Hi!

    I have a large set of data with 3 columns: ID #, Start Date, Stop Date.

    I need to write a formula that will indicate which row, if the ID # appears in the data set twice, has fewer days between Start and Stop Date.

    I'm playing around nesting Ifs and Countifs, and would like to ultimately have it return:
    - a 0 for rows containing an ID # that isn't repeated
    - a 0 for rows with duplicate ID #s that have the longer span between Start Date and Stop Date
    - a 1 for rows with a duplicate ID #, that has fewer days between Start and Stop than other occurences of the same ID #


    Attached is an example spreadsheet that better explains exactly what I need to do.

    Duplicates with Varying Date Ranges.xlsx

    As always, thanks for any input!

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Indicate Duplicate with Small Time Span? (ID#, Start Date, Stop Date columns)

    See if this workbook helps.

    The helpers, ColumnsD:E, can be moved or hidden with the grouping button.
    The formula in F2 is an array and must be confirmed with Ctrl+Shift+Enter not just Enter, then Drag Across and Down.

    [EDIT]
    Not quite what you asked for, but can be easily modified.
    Attached Files Attached Files
    Last edited by Marcol; 09-25-2012 at 02:31 PM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    06-13-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    63

    Re: Indicate Duplicate with Small Time Span? (ID#, Start Date, Stop Date columns)

    This is very interesting, but it doesn't do what I need it to - or maybe I don't understand it correctly.

    My thought process right now is to use something like: If, CountIf > 1, then Lookup (A1), return Max/Large Column D (Duration)

  4. #4
    Registered User
    Join Date
    06-13-2012
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    63

    Re: Indicate Duplicate with Small Time Span? (ID#, Start Date, Stop Date columns)

    Well, in case anyone has been following along and is interested: I decided to just add a "Duration" column in D (column C - column B), then Sort, by ID # then Duration, and in column E just use the formula =if(a2=a3,"",1).

    Copy+Paste Values, sort by column E, and there's each unique occurence with the longest duration.

    Thanks for stoppin'!

+ 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