formula help on a sheet

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
2,144
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi All

I have data in a sheet in column A and column B.
I want to end up filtering column C dependant on if it has a "1"

Column A looks like this.

A2=07:20
A3=Grade: A9 Prize: £62 Distance: 470m Going: -170
A4=http://www.site/dog_home.sd?dog_id=1
A5=http://www.site/dog_home.sd?dog_id=6
A6=http://www.site/dog_home.sd?dog_id=4
A7=http://www.site/dog_home.sd?dog_id=12
A8=http://www.site/dog_home.sd?dog_id=100
A9=http://www.site/dog_home.sd?dog_id=29

Then it repeats as above with another batch of data similar. Generally the data is 8 lines long, but sometimes not, that is MY PROBLEM.I want to filter the data that had all 6 runners. So in the example above c2,c3,c3,c4,c5,c6,c7,c8,c9 would ="1".
But in the example below c2,c3,c3,c4,c5,c6,c7,c8 would =""

A2=07:20
A3=Grade: A9 Prize: £62 Distance: 470m Going: -170
A4=http://www.site/dog_home.sd?dog_id=1
A5=http://www.site/dog_home.sd?dog_id=6
A6=http://www.site/dog_home.sd?dog_id=4
A7=http://www.site/dog_home.sd?dog_id=12
A8=http://www.site/dog_home.sd?dog_id=100

If it helps column B looks like this.

[TABLE="width: 309"]
<tbody>[TR]
[TD]B2=07:20
B3=Grade: A9 Prize: £62
B4=Hawaiian Flash[/TD]
[/TR]
[TR]
[TD]B5=Smooth Lane[/TD]
[/TR]
[TR]
[TD]B6=Under The Limit[/TD]
[/TR]
[TR]
[TD]B7=Whitelaithelady[/TD]
[/TR]
[TR]
[TD]B8=Drumsna Lucy[/TD]
[/TR]
[TR]
[TD]B9=Birkdale Lass

The whole thing is to do with is there blocks of 8 and if they are part of the block of 8 I want to filter and keep and if not filter out before a copy and paste.

Thanks for looking.

Dave
[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
 
Okay, I see what you were asking for now. This modification to the code I posted earlier should work for you...
Code:
[table="width: 500"]
[tr]
	[td]Sub SixRunners()
  Dim NonTimeData As Range
  Columns("C").ClearContents
  For Each NonTimeData In Columns("A").SpecialCells(xlConstants, xlTextValues).Areas
    If NonTimeData.Rows.Count = 7 [B][COLOR="#0000FF"]And Left(NonTimeData(1).Value, 8) = "Grade: A"[/COLOR][/B] Then NonTimeData.Offset(-1, 2).Resize(NonTimeData.Count + 1).Value = 1
  Next
End Sub[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0
Nice one rick.

Spot one,
I love it.

Works like a Charm

Thank you very much
 
Upvote 0

Book1
ABCDE
207:20
3Grade: A9 Prize: £62 Distance: 470m Going: -170ok$B$4:$B$10
4http://www.site/dog_home.sd?dog_id1ok$B$4:$B$10
5http://www.site/dog_home.sd?dog_id6ok$B$4:$B$10
6http://www.site/dog_home.sd?dog_id4ok$B$4:$B$10
7http://www.site/dog_home.sd?dog_id12ok$B$4:$B$10
8http://www.site/dog_home.sd?dog_id100ok$B$4:$B$10
9http://www.site/dog_home.sd?dog_id29ok$B$4:$B$10
1007:20failure
11Grade: A9 Prize: £62 Distance: 470m Going: -170$B$12:$B$18
12http://www.site/dog_home.sd?dog_id1$B$12:$B$18
13http://www.site/dog_home.sd?dog_id6$B$12:$B$18
14http://www.site/dog_home.sd?dog_id4$B$12:$B$18
15http://www.site/dog_home.sd?dog_id12$B$12:$B$18
16http://www.site/dog_home.sd?dog_id100$B$12:$B$18
1707:20failure
18Grade: A9 Prize: £62 Distance: 470m Going: -170ok$B$19:$B$25
19http://www.site/dog_home.sd?dog_id1ok$B$19:$B$25
20http://www.site/dog_home.sd?dog_id6ok$B$19:$B$25
21http://www.site/dog_home.sd?dog_id4ok$B$19:$B$25
22http://www.site/dog_home.sd?dog_id12ok$B$19:$B$25
23http://www.site/dog_home.sd?dog_id100ok$B$19:$B$25
24http://www.site/dog_home.sd?dog_id29ok$B$19:$B$25
2507:20failure
26Grade: A9 Prize: £62 Distance: 470m Going: -170$B$27:$B$33
27http://www.site/dog_home.sd?dog_id1$B$27:$B$33
28http://www.site/dog_home.sd?dog_id6$B$27:$B$33
29http://www.site/dog_home.sd?dog_id4$B$27:$B$33
30http://www.site/dog_home.sd?dog_id12$B$27:$B$33
31http://www.site/dog_home.sd?dog_id100$B$27:$B$33
32
Blad22
Cell Formulas
RangeFormula
D3=IFERROR(IF(AND(LEFT($A3,5)="Grade",COUNTIF(INDIRECT($E3),">0")=6),"ok",IF(AND($D2="ok",LEFT(A3,4)="http"),"ok","")),"failure")
E3=IF(LEFT(A3,4)="http",E2,IF(LEFT(A3,5)="grade",ADDRESS(ROW()+1,2)&":"&ADDRESS(ROW()+7,2),""))
 
Upvote 0

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