Count Unique Items
If a name that is associated with "orange" is also associated with another
location you'll get incorrect results. Using the OP's sample data, change
one of the names for "la" to Bob (which is also associated with "orange").
Try this array formula** (does not account for empty cells):
=SUM(--(FREQUENCY(IF(A1:A11="orange",MATCH(B1:B11,B1:B11, 0)),ROW(B1:B11)-MIN(ROW(B1:B11))+1)0))
** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)
--
Biff
Microsoft Excel MVP
"Mike H" wrote in message
...
Or without a helper column
=SUMPRODUCT((A1:A100="Orange")/COUNTIF(B1:B100,B1:B100&"")*(B1:B100<""))
Mike
"Noel" wrote:
I want to count the unique items in a list where a related field matches
another criteria. For example,
A B
1 orange bob
2 orange sue
3 orange hank
4 la ted
5 la ted
6 la ted
7 la joe
8 orange bill
9 orange deb
10 orange sue
11 orange bill
I want to count how many unique people there are in Orange.
|