Hello!
Long time reader, first time poster. Using MS Excel 2010. I need to count the number of rows in a sumif until a max value is reached.
In the example below, the data is sorted large to small by dollars. I need to know how many rows of category "CAR" are needed until max $ "6" is reached. The correct answer is 2. I can achieve the correct number of rows without the category using ={MATCH(D2,SUBTOTAL(9,OFFSET(B4,,,ROW(B4:B18)-ROW(B4))),1)}. But this does not factor in the category. I'd prefer a formula over vba and the actual data prohibits the use of helper columns because of other data pasted in around it in the report.
Thanks!
<tbody>
</tbody>
Long time reader, first time poster. Using MS Excel 2010. I need to count the number of rows in a sumif until a max value is reached.
In the example below, the data is sorted large to small by dollars. I need to know how many rows of category "CAR" are needed until max $ "6" is reached. The correct answer is 2. I can achieve the correct number of rows without the category using ={MATCH(D2,SUBTOTAL(9,OFFSET(B4,,,ROW(B4:B18)-ROW(B4))),1)}. But this does not factor in the category. I'd prefer a formula over vba and the actual data prohibits the use of helper columns because of other data pasted in around it in the report.
Thanks!
A | B | C | D | |
1 | category | max $ | ||
2 | CAR | 6 | ||
3 | category | dollars | ||
4 | PLANE | 3.59 | ||
5 | HELI | 3.35 | ||
6 | PLANE | 3.27 | ||
7 | PLANE | 3.26 | ||
8 | CAR | 3.24 | ||
9 | CAR | 3.05 | ||
10 | CAR | 2.26 | ||
11 | PLANE | 2.25 | ||
12 | CAR | 1.95 | ||
13 | PLANE | 1.63 | ||
14 | CAR | 1.56 | ||
15 | HELI | 1.56 | ||
16 | HELI | 1.29 | ||
17 | HELI | 1.27 | ||
18 | HELI | 1.23 |
<tbody>
</tbody>