+ Reply to Thread
Results 1 to 10 of 10

Removing time stamps that are less then "x" seconds after the previous time stamp

  1. #1
    Registered User
    Join Date
    03-28-2022
    Location
    Australia
    MS-Off Ver
    Home and Student 2019
    Posts
    5

    Removing time stamps that are less then "x" seconds after the previous time stamp

    G'day everyone,

    I have come across a problem that I am struggling to find a solution for and hoping someone can help me out.

    Basically we use a device to take a time stamp on an up ramp of a signal. Occasionally however the device triggers again on the down ramp, 30 seconds later.
    We do not trigger the device again for at least another 30 seconds, so im trying to find a formula that can help me identify and remove any row where its timestamp is less then 35 seconds after the previous time stamp above it.

    Now i think that bit is fairly simple, however, the time stamps are in the format: hh:mm:ss.000000
    Once i go to 6 decimal places of a second, excel seems to get very tricky and i cant currently have the data as a time format, i have to have it as a text format.


    The example workbook shows the data after I have ran a macro to separate the time stamps into the individual parts. (Hours, Minutes, Seconds, etc.) Then also how i have joined these back together to be used later.
    As you can see, row 5 and 6 are just 30 seconds apart and therefor i would delete row 6. Same with 13 and 14 where i would delete row 14.


    We are trying to fix the problem in the first place but for the time been i have alot of data that i need to manually sort through to find the incorrect timestamps and delete them which is taking a long time.

    Would appreciate any help with the issue.

    Thanks!


    Jim.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,936

    Re: Removing time stamps that are less then "x" seconds after the previous time stamp

    See if this helps.

    Add a Helper column and use the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    in row 3 and copied down.

    Then filter for the lowest values you require.
    Attached Files Attached Files
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    11-05-2020
    Location
    England
    MS-Off Ver
    365
    Posts
    163

    Re: Removing time stamps that are less then "x" seconds after the previous time stamp

    Hi Jim,

    may not be the neatest but please see attached spreadsheet,
    I have changed the formatting of the time (New column Q) (column O can be deleted) to use a time formula and then created an IF statement in column S.

    To remove the errors you can filter column S by the "1" and delete the rows.

    If you want an explanation of the formulas, please let me know.

    Apologies, please use the formula below in column S:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Farley945; 03-28-2022 at 05:06 AM. Reason: Updated formula

  4. #4
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,142

    Re: Removing time stamps that are less then "x" seconds after the previous time stamp

    with the start and end times in format: hh:mm:ss.000000
    start time in A2
    end time in B2

    use this formula:
    Please Login or Register  to view this content.
    sample file attached
    As a gesture off appreciation, you can click * Add Reputation at the foot of any of the posts of members who helped you reach a solution.

    And finally, was your problem solved? if so, please click Thread Tools above the first post of your enquiry, then select [Solved]

  5. #5
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,767

    Re: Removing time stamps that are less then "x" seconds after the previous time stamp

    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  6. #6
    Registered User
    Join Date
    03-28-2022
    Location
    Australia
    MS-Off Ver
    Home and Student 2019
    Posts
    5

    Re: Removing time stamps that are less then "x" seconds after the previous time stamp

    Wow, thanks everyone that replied. The support was awesome, really appreciate the time each one of you put in!
    I really like seeing all the different ways it could possibly be solved.

    janmorris
    Thanks heaps for that very complicated looking formula. I really like it as i can visually see the time difference between points which is interesting. Only thing i noticed is when it cross's the 12 hour mark it throws a funny number. It really is not a big deal as i can just sort through each one at every 12th hour but i thought if there is a simple change of formula that would be cool. But don't expect you to spend time on it again. What you have done so far is great.

    KOKOSEK
    Thanks very much for your help. I'm no expert with excel but I'm guessing yours is some sort of macro? I would love to give yours a go but not exactly sure on how to plug it in, i have only ever recorded my own macros in the past. If you could point me in the right direction that would be great thanks.
    Should of had a better google first. Think Ive got it sorted. Very cool. Thanks!


    Thanks again everyone!


    Jim.
    Last edited by Navara32; 03-28-2022 at 09:34 PM.

  7. #7
    Registered User
    Join Date
    03-28-2022
    Location
    Australia
    MS-Off Ver
    Home and Student 2019
    Posts
    5

    Re: Removing time stamps that are less then "x" seconds after the previous time stamp

    Just want to say these worked like a treat. I wanted to make a macro out of it anyway so I used KOKOSEK's suggestion. What would take me hours of crosschecking again and again just took me a few minutes to go through. You have made my life so much easier. Thanks Mate!

    Because sometimes we change the duration, am i able to simply change the "00:00:35" in the code to what ever i like. Thats all i have to do?
    Last edited by Navara32; 03-29-2022 at 01:31 AM.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,936

    Re: Removing time stamps that are less then "x" seconds after the previous time stamp

    Thanks for the rep.

    Because sometimes we change the duration, am i able to simply change the "00:00:35" in the code to what ever i like. Thats all i have to do?
    Yep, that's it.

  9. #9
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,142

    Re: Removing time stamps that are less then "x" seconds after the previous time stamp

    @Navara32

    do you get some kind of error?
    can you give more detail on the anomaly?

    in my testing...
    with a start time of 01:38:26.677483
    and an end time of 23:38:26.790675
    i get a result of 79200.113192

    and as there are 86400 seconds in a day, and 3600 seconds in an hour (7200 seconds in 2 hours), this is correct.

    im working on Mac and Google Sheets, which give identical results.

    ---

    to explain the formula a little bit...
    "TIME" ensures the numbers are treated as parts of time, and not as raw numbers (eg. 6 hours and 30 minutes can be given as 6.5 hours, or 6:30)
    "MID" and "RIGHT" pulls a certain number of characters from a certain position
    "*24*60*60" is for the hours, minutes, seconds
    "/1000000" is for the microseconds
    Last edited by janmorris; 03-29-2022 at 03:23 AM.

  10. #10
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,767

    Re: Removing time stamps that are less then "x" seconds after the previous time stamp

    Happy to help.

+ 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. [SOLVED] Time stamp overlap between two columns and identify such rows with "Yes"
    By kjaikishan in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-12-2020, 02:55 PM
  2. [SOLVED] New Table entry updates all the Time Stamps in column "A" for every line on the Table1.
    By Mr.GfCs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2016, 04:28 AM
  3. Add date/time stamp to comment when cell is marked "X"
    By msaric in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-28-2016, 07:31 AM
  4. Excel 2007 VBA - "Suggest" Filename with Time Stamp?
    By Tomkat in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 03-11-2013, 03:21 PM
  5. Convert "Time Interval" in "hours : minutes : seconds" to seconds
    By deano27 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-28-2008, 09:07 AM
  6. How do I put a "date & time saved" stamp inside an Excel Wksht?
    By Bill in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-12-2005, 12:06 PM
  7. Replies: 7
    Last Post: 05-08-2005, 04:06 PM

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