Count formula
In order to use a single formula that can be copied you need to create some
meaningful column headers that can be referenced by the formula.
I assume that month is the month number where 1 = Jan and 12 = Dec.
Let's assume your data is in the range A2:B13 and there are no empty cells
in B2::B13.
Enter these column headers for the table:
E1:G1 = 0,2,7
E2:G2 = 1,6,12
D3:D6 = A,B,C,D
Enter this formula in E3:
=SUMPRODUCT(--($A$2:$A$13=$D3),--($B$2:$B$13=E$1),--($B$2:$B$13<=E$2))
Copy across to G3 then down to E6:G6.
--
Biff
Microsoft Excel MVP
"Ryan L." <Ryan wrote in message
...
Hi All,
I have the following data:
Product Month
A 1
B 1
C 1
A 2
B 3
A 4
B 7
C 2
D 3
B 1
C 2
D 9
Could you please provide me the formula to count A, B, C, and D with below
conditions:
<2 months 2 - 6 months 6 months
A count= ? ? ?
B ? ? ?
C ? ? ?
D ? ? ?
Thanks & regards,
|