Count Rows Until Cell Value or Cell Value Changes

STIguy

New Member
Joined
Nov 5, 2014
Messages
26
Experts,

I'm stuck on a custom sort. I have converted the data into a tiered format, but now I would like to go through the "Level" column and determine the number of Level 3 entries in each group. For the following data I would like to return the number of rows in each Level 3 group. A named integer would be perfect.

L2item Group 1 - 5 rows of Level 3 items
L2item Group 2 - 4 rows of Level 3 items
L2item Group 3 - 3 rows of Level 3 items

Any advice is greatly appreciated!

Data set:

[TABLE="width: 321"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]Level[/TD]
[TD]L2 Item[/TD]
[TD]PN[/TD]
[TD]Description[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD] [/TD]
[TD]1000[/TD]
[TD]Truck[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]101[/TD]
[TD]Apple[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]501[/TD]
[TD]Dog[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]502[/TD]
[TD]Cat[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]503[/TD]
[TD]Snake[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]504[/TD]
[TD]Shark[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]506[/TD]
[TD]Tiger[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2[/TD]
[TD]102[/TD]
[TD]Orange[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD]601[/TD]
[TD]Spider[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD]602[/TD]
[TD]Zebra[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3[/TD]
[TD]103[/TD]
[TD]Banana[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]3[/TD]
[TD]701[/TD]
[TD]Fish[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]3[/TD]
[TD]703[/TD]
[TD]Pig[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]3[/TD]
[TD]704[/TD]
[TD]Cougar[/TD]
[/TR]
</tbody>[/TABLE]
 
ah, I see now. That's pretty fancy. I'm a VBA newb, so I am used to doing things with an ugly brute force method. Now out of curiosity along those lines...is it possible to create a variable that stores a list in which the contents of that list are populated from multiple non-consecutive ranges?
 
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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