Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8661357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:28:43+00:00 2026-06-12T16:28:43+00:00

I have a table with 3 groups (defined by values ‘1G, 3G or 5G’

  • 0

I have a table with 3 groups (defined by values ‘1G, 3G or 5G’ in column B) as shown below.

For every time (column A) of value 1G, I need to test if a value 3G appears within 10 minutes (shown in column A) of 1G. If so, then I need to test if a value 5G appears within 20 minutes (of time for value 1G).

So read time ‘1G’ then read time ‘3G’ and if =< 10 minutes, then read time ‘5G’ =< 20 minutes.

'Time'    'Group Name'  'Data'
----------
12:08 am       1G        747
12:45 am       1G        745
1:00 am        1G        746
12:36 am       3G        743
12:45 am       3G        747
1:03 am        3G        74
12:50 am       5G        75
1:00 am        5G        741

Format ‘Time’: 9/25/2012 8:37:00 pm

I’m looking to write the result on a new sheet with all data per row.

I have looked at answers on this site and others, but not found answers.
Thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:28:44+00:00Added an answer on June 12, 2026 at 4:28 pm

    This macro will extract all 1G line that have a 3G within 10 minutes, and a 5G within 20.

       Sub Macro2()
    Dim lLastRow As Long, shtOrg As Worksheet, shtDest As Worksheet, rgLoop As Range
    
    'turn off updates to speed up code execution
    With Application
        .ScreenUpdating = False
        .EnableEvents = False
        .Calculation = xlCalculationManual
    End With
    
    Set shtOrg = ActiveSheet
    Set shtDest = Sheets.Add
    
    lLastRow = shtOrg.Cells(Rows.Count, 1).End(xlUp).Row
    
    shtOrg.Range("D2:D" & lLastRow).FormulaR1C1 = _
            "=IF(RC[-2]=""1G"",IF(COUNTIFS(C[-3],"">="" &RC[-3],C[-3],""<=""&RC[-3]+10/1440,C[-2],""3G"")*COUNTIFS(C[-3],"">="" &RC[-3],C[-3],""<=""&RC[-3]+20/1440,C[-2],""5G"")>0,TRUE,""""),"""")"
    shtOrg.Range("E2:E" & lLastRow).FormulaR1C1 = _
            "=N(IF(RC[-3]=""3G"",COUNTIFS(C[-1],TRUE,C[-4],""<=""&RC[-4],C[-4],"">=""&RC[-4]-10/1440),IF(RC[-3]=""5G"",COUNTIFS(C[-1],TRUE,C[-4],""<=""&RC[-4],C[-4],"">=""&RC[-4]-20/1440),"""")))>0"
    
    shtOrg.Range("A1:E" & lLastRow).AutoFilter field:=4, Criteria1:="TRUE"
    
    shtOrg.Range("A1:C" & lLastRow).SpecialCells(xlCellTypeVisible).Copy shtDest.Cells(1, 1)
    
    shtOrg.Range("A1:E" & lLastRow).AutoFilter
    shtOrg.Range("A1:E" & lLastRow).AutoFilter field:=5, Criteria1:="TRUE"
    shtOrg.Range("A2:C" & lLastRow).SpecialCells(xlCellTypeVisible).Copy shtDest.Cells(Rows.Count, 1).End(xlUp).Offset(1)
    
    shtOrg.Columns("D:E").ClearContents
    shtOrg.Range("A1:E" & lLastRow).AutoFilter
    
    
    With Application
        .ScreenUpdating = True
        .EnableEvents = True
        .Calculation = xlCalculationAutomatic
    End With
    
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table of Groups that have a capacity column and has a
I have a Groups table and a Participants table. Now I need to insert
I have an entity mapped as following: @Entity @Table(name = Groups) @IdClass(value = GroupId.class)
I have a rank table and its schema is defined as rank(id, key,value) where
I have the following two table: -Groups- Id Name -Members- Id GroupId (Group.Id is
I have a table that assign elements to groups. Each element can exist in
I have a many-to-many relationship between users and groups and I have a table
I have the following two tables in my mysql database. Table Name: groups id
I have a table that I need to normalize with many fields In SQL-Server
I have an SQL Table named samples, defined like this: sampledate (datetime, 24 records

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.