ReggieMack
New Member
- Joined
- Oct 19, 2002
- Messages
- 6
I'm trying to count unique occurrances of items in a particular column of a table using SUMPRODUCT. The formula that is working for me is SUMPRODUCT((IF(FREQUENCY(B1:B11,B1:B11)>0,1,0))). This works just fine!
My intent is to add criteria, incrementally, building the formula to inlude/exclude rows based on other columns in the table. My 1st attempt was to include rows marked to include with a "Yes" in an "Include" column. For example:
"A" "B"
# Item Include # Item Include
1 100 Yes 1 100 Yes
2 103 Yes 2 103 Yes
3 100 Yes 3 100 Yes
4 103 Yes 4 103 No
5 109 Yes 5 109 No
6 104 Yes 6 104 No
7 102 Yes 7 102 Yes
8 111 Yes 8 111 Yes
9 100 Yes 9 100 Yes
So, in this example with the 2 tables, Table "A" should produce a count of 6 unique items and Tabe "B" should produce a count of 4 unique items based on the "Include" column and either excluding "Items" rows if "Include" is "No" or including "Items" rows if "Include" is "Yes" into the count uniques on the "Item" column using the SUMPRODUCT formulation above as the basis and adding additional criteria to include/exclude. I've tried several permutations including the asterisk, the double unary ",--", etc. I've even tried:
=SUMPRODUCT((IF(FREQUENCY(IF(IncludeRng="Yes",ItemRng,""),ItemRng)>0,1))).
I was quite certain that this would work. But, it didn't. Apparently, I don't understand the SUMPRODUCT function as well as I had thought!!! Does anyone have any suggestions? For the sake of my education on this function, I'd like to stay with utilizing SUMPRODUCT as the basis for any solutions. Thanks all!
My intent is to add criteria, incrementally, building the formula to inlude/exclude rows based on other columns in the table. My 1st attempt was to include rows marked to include with a "Yes" in an "Include" column. For example:
"A" "B"
# Item Include # Item Include
1 100 Yes 1 100 Yes
2 103 Yes 2 103 Yes
3 100 Yes 3 100 Yes
4 103 Yes 4 103 No
5 109 Yes 5 109 No
6 104 Yes 6 104 No
7 102 Yes 7 102 Yes
8 111 Yes 8 111 Yes
9 100 Yes 9 100 Yes
So, in this example with the 2 tables, Table "A" should produce a count of 6 unique items and Tabe "B" should produce a count of 4 unique items based on the "Include" column and either excluding "Items" rows if "Include" is "No" or including "Items" rows if "Include" is "Yes" into the count uniques on the "Item" column using the SUMPRODUCT formulation above as the basis and adding additional criteria to include/exclude. I've tried several permutations including the asterisk, the double unary ",--", etc. I've even tried:
=SUMPRODUCT((IF(FREQUENCY(IF(IncludeRng="Yes",ItemRng,""),ItemRng)>0,1))).
I was quite certain that this would work. But, it didn't. Apparently, I don't understand the SUMPRODUCT function as well as I had thought!!! Does anyone have any suggestions? For the sake of my education on this function, I'd like to stay with utilizing SUMPRODUCT as the basis for any solutions. Thanks all!