I need assistance on a macro for counting data in a column.
Specifically looking to count the number of rows until a repeating number of 1 , 2 or 3.
In other words counting the interval for a streak of length 2.
(Note: 0 can not be a repeating number or streak but will be counted for the interval of the numbers 1, 2 or 3.)
A1,A2 is the first streak of length 2 (for #1) and it took 2 rows. So in column C, C1 would show 2 and the counting starts over.
A6,7 shows the next streak of 2 (for #3). It took 5 rows starting from A3, So 5 would go into cell C2 since there is already a value in C1.
Hope this makes sense.
photo and data below
Specifically looking to count the number of rows until a repeating number of 1 , 2 or 3.
In other words counting the interval for a streak of length 2.
(Note: 0 can not be a repeating number or streak but will be counted for the interval of the numbers 1, 2 or 3.)
A1,A2 is the first streak of length 2 (for #1) and it took 2 rows. So in column C, C1 would show 2 and the counting starts over.
A6,7 shows the next streak of 2 (for #3). It took 5 rows starting from A3, So 5 would go into cell C2 since there is already a value in C1.
Hope this makes sense.
photo and data below
Code:
1 2
1 5
2 2
3 2
1 4
3 2
3 2
1 2
1 3
1 3
1 2
0 2
3
2
2
1
1
3
3
3
3
1
2
2
1
2
2
3
3
3
3