ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Select certain data rows (https://www.excelbanter.com/new-users-excel/123190-select-certain-data-rows.html)

lee's news

Select certain data rows
 
I have 5 columns of data, the first column is time. In this column each row
is incremented in 5mins. So it goes 0,5,10,15,20,25 etc. I want to filter
the data to only show rows every 60 minutes i.e. 0,60,120,180 etc. Have can
i do this, ive had a play with filters but cant seem to find a way. I have
1000's of minutes so it is a pain to manually select each row.

many thanks



Gary''s Student

Select certain data rows
 
Use a helper column, say column B (could be any spare column).

In B2 enter:
=MOD(A2,60) and copy down

You will see in A1 thru B25 something like:

time helper
5 5
10 10
15 15
20 20
25 25
30 30
35 35
40 40
45 45
50 50
55 55
60 0
65 5
70 10
75 15
80 20
85 25
90 30
95 35
100 40
105 45
110 50
115 55
120 0


Then turn on the AutoFilter and select 0 for the helper column.
--
Gary's Student


"lee's news" wrote:

I have 5 columns of data, the first column is time. In this column each row
is incremented in 5mins. So it goes 0,5,10,15,20,25 etc. I want to filter
the data to only show rows every 60 minutes i.e. 0,60,120,180 etc. Have can
i do this, ive had a play with filters but cant seem to find a way. I have
1000's of minutes so it is a pain to manually select each row.

many thanks




Otto Moehrbach

Select certain data rows
 
One way: (VBA solution)
I assumed the time values are in Column A starting with A2. HTH Otto
Sub HideRows60()
Dim TheRng As Range
Dim c As Long
Set TheRng = Range("A2", Range("A" & Rows.Count).End(xlUp))
For c = TheRng.Count To 1 Step -1
If TheRng(c).Value Mod 60 < 0 Then _
TheRng(c).EntireRow.Hidden = True
Next c
End Sub

"lee's news" wrote in message
...
I have 5 columns of data, the first column is time. In this column each row
is incremented in 5mins. So it goes 0,5,10,15,20,25 etc. I want to filter
the data to only show rows every 60 minutes i.e. 0,60,120,180 etc. Have can
i do this, ive had a play with filters but cant seem to find a way. I have
1000's of minutes so it is a pain to manually select each row.

many thanks





All times are GMT +1. The time now is 08:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com