+ Reply to Thread
Results 1 to 6 of 6

Find duplicate rows where value of cell with time criteria is within 30 mins

  1. #1
    Registered User
    Join Date
    07-16-2004
    Location
    Hampshire, England
    MS-Off Ver
    2007
    Posts
    29

    Find duplicate rows where value of cell with time criteria is within 30 mins

    Hi

    I have several rows of data eg

    A B C D
    1 Date Time ID GateNo
    2 30/10/2013 09:24 1224 2
    3 30/10/2013 23:34 1224 3
    4 29/10/2013 09:45 2456 2
    5 30/10/2013 23:10 1224 3
    6 31/10/2013 00:01 1224 3

    I want to find rows where the values in columns C and D are identical AND where the Date/Time (columns A and B) are within 30 minutes. So in the example, this would be rows 3, 5 and 6 where the ID and GateNo are the same and the times are within 30 minutes of each other (note, rows 3 and 6 are within 30 mins but on different dates).

    Thanks.
    Last edited by emm8080; 10-31-2013 at 08:00 AM.

  2. #2
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Find duplicate rows where value of cell with time criteria is within 30 mins

    Try this:-
    This code will show results in column "E" on.
    Please Login or Register  to view this content.
    Regards Mick

  3. #3
    Registered User
    Join Date
    07-16-2004
    Location
    Hampshire, England
    MS-Off Ver
    2007
    Posts
    29

    Re: Find duplicate rows where value of cell with time criteria is within 30 mins

    Hi Mick

    That's great! One thing: With example below Person4 on the 8th row is within 30 mins of Person4 on the 7th row, but not showing as Dupe - I guess because it's not within 30mins of the first Dup2 time? So rows 6, 7 and 8 should all be Dupes as shown by (Dup4). Appreciate this adds an extra layer of complexity! Thanks for your help! Emma

    Date Time ID GateNo
    23/09/2013 20:33 Person1 A45
    23/09/2013 20:33 Person2 A45 Dup1
    23/09/2013 20:33 Person3 A45
    23/09/2013 20:33 Person4 A45 Dup2
    23/09/2013 20:43 Person2 A45 Dup1
    23/09/2013 20:23 Person4 A45 Dup2 (Dup4)
    23/09/2013 20:13 Person4 A45 Dup2 (Dup4)
    23/09/2013 20:02 Person4 A45 (Dup4)
    23/09/2013 23:55 Person3 A22 Dup3
    24/09/2013 00:15 Person3 A22 Dup3
    23/09/2013 19:40 Person4 A45 (Dup4)

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Find duplicate rows where value of cell with time criteria is within 30 mins

    Try this:- This is better code.
    The results need some interpretation, because for each set of unique "ID GateNo", the code looks at each time within the related set of times to find any others times that are within 30 min of the first time. Then it does the same for each susequent time in the set of related times.
    As a Consequence you get these half related sets of dups.
    Please Login or Register  to view this content.
    Regards Mick

  5. #5
    Registered User
    Join Date
    07-16-2004
    Location
    Hampshire, England
    MS-Off Ver
    2007
    Posts
    29

    Re: Find duplicate rows where value of cell with time criteria is within 30 mins

    Sorry for late response...thank you so much for your help, I'm sure I can work with this!
    Kind regards Emma

  6. #6
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Find duplicate rows where value of cell with time criteria is within 30 mins

    Thanks for your reply:-
    The code below should give better results, as it checks each Unique person against each duplicate of that unique person and returns the results starting column "E" .
    NB:- Your actual data is expected to start on row (2) , as per your thread data.
    Please Login or Register  to view this content.
    Regards Mick

+ 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. Replies: 3
    Last Post: 05-22-2012, 03:26 PM
  2. Replies: 1
    Last Post: 01-26-2012, 10:06 AM
  3. Find duplicate info in two columns and copy info from duplicate rows
    By USGS in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-12-2011, 07:31 PM
  4. Time Converter : Mins/Secs to Hours/Mins
    By jamesgsi1983 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2009, 09:02 AM
  5. Find and isolate duplicate criteria
    By LD2020 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-07-2009, 10:57 AM

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