Removing duplicate time cells/rows from large data tables

simonbevan

New Member
Joined
Jan 26, 2018
Messages
5
Hello,

I wonder if anyone can help. I need to remove multiple cell/row data based on UTC time excluding seconds (ss). By example, I would like to auto remove all rows except A-M, T, V, X-Z in the below table. ID N-O-P-S are all minute 20 data but I only need to keep the first entry of any minute data for further analysis. So the cells/rows that need auto deleting are: O,P,S & U. Some of my data files are 3000 rows in length and I am trying to find a quick means of filtering out data I do not need for further analysis.

IDNameTimestampUTCReportOwnershipSpeedCourseLatitudeLongitude
ANPAC31/12/2017 23:59Auto0xA013.57826.9397733166.601905
BNPAC31/12/2017 23:29Auto0xA0138026.9178233166.4819367
CNPAC31/12/2017 23:21Auto0xA0137926.9127133166.4528817
DNPAC31/12/2017 22:52Auto0xA0137626.8884783166.33775
ENPAC31/12/2017 22:16Auto0xA0137426.8554767166.199985
FNPAC31/12/2017 22:15Auto0xA0137226.8545967166.196685
GNPAC31/12/2017 21:41Auto0xA012.47326.8203483166.0682167
HNPAC31/12/2017 21:38Auto0xA0137726.817525166.0569183
MNPAC31/12/2017 21:21Auto0xA0137226.7993217165.989415
NNPAC31/12/2017 21:20Auto0xA012.47126.7991417165.9886467
ONPAC31/12/2017 21:20Auto0xA012.47126.7991417165.9886467
PNPAC31/12/2017 21:20Auto0xA012.47526.79898165.988075
SNPAC31/12/2017 21:20Auto0xA0137226.79834165.9856367
TNPAC31/12/2017 20:19Auto0xA012.47526.798125165.9848717
UNPAC31/12/2017 20:19Auto0xA012.47526.798125165.9848717
VNPAC31/12/2017 19:19Auto0xA0137026.7978467165.9837333
XNPAC31/12/2017 18:19Auto0xA0137026.7978467165.9837333
YNPAC31/12/2017 17:18Auto0xA0137226.7962217165.9779233
ZNPAC31/12/2017 16:17Auto0xA0137526.796005165.9772283

<colgroup><col span="2"><col><col><col><col span="2"><col><col></colgroup><tbody>
</tbody>

I trust this makes sense!
Simon
 
1st step put =ISNUMBER(C2) in an empty column and drag the formula down to your last row to make sure the result is TRUE on all the cells.
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Just as a silly follow up, what results do you get with...

Code:
Sub CleanupTable()
    Dim row As Long
    Dim times As New Collection
    Dim currentDate As Date, d

    row = 2

    Do While Not IsEmpty(Cells(row, 3))
        currentDate = Cells(row, 3)

        For Each d In times
            If Round(DateAdd("s", -Second(d), d), 4) = Round(DateAdd("s", -Second(currentDate), currentDate), 4) Then
                Rows(row).Delete
                GoTo NextLoop
            End If
        Next

        times.Add (currentDate)
        row = row + 1
NextLoop:
    Loop
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,529
Messages
6,125,344
Members
449,219
Latest member
Smiqer

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top