Subset data set by removing records with only one row per hour

Buck1480

Board Regular
Joined
Feb 1, 2009
Messages
102
I have a data set of GPS locations for a wildlife research project. GPS locations were collected 2x per hour (every 30 mins). However, the GPS collars sometimes would miss a location resulting in 1 location/hour. I need to subset my data set to only include locations where I have 2 GPS locations per hour (i.e., remove rows with only one location per hour). My issue is that due to the hierarchical data structure (GPS locations are nested within individual animal ID, Month, Day, Year, and Hour) I cannot find a simple solution to remove rows with only 1 location/hour. In the example data set below, I would only keep the locations at 10 am and 10:30 am (noted in red). In other words, I need to obtain a final file that contains only data with 2 locations per hour. Thanks for any help that you can provide!

Collar_IDDATETIMEWEEKYEARMONTHDAYHOURMOVEMENT_DISTANCENET_DISPLACEMENT
3382710/1/2013 8:00111018103.6
3382710/1/2013 10:00111011078.1135.4
3382710/1/2013
10:30
111011099.8205.7
3382710/1/2013 11:00111011192.7222.7
3382710/1/2013 13:00111011327.7370.5
3382710/1/2013 14:3011101148372.0
3382710/1/2013 15:0011101155366.0

<tbody>
</tbody>





 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Why wouldn't the last two (which are within 1/2 hour of each other) be retained? Is it because the first one does not start "on the hour"?
 
Upvote 0
Why wouldn't the last two (which are within 1/2 hour of each other) be retained? Is it because the first one does not start "on the hour"?

That's correct! First location needs to be at the start of the hour (e.g., 14:00 followed by the second location at 14:30).
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,836
Members
449,096
Latest member
Erald

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