Reputation: 35
I'm stuck trying to calculate the number of unique numbers in column A if column B has a yes. The formula should output a value of 2, as only numbers 1 and 4 have a Yes next to them.
Edit: Title, did read SCOUNTIF amended to COUNTIF
Upvotes: 0
Views: 529
Reputation: 75840
Having Excel O365, you could use:
=COUNT(UNIQUE(FILTER(A2:A9,B2:B9="Yes")))
With earlier versions of Excel you could use:
=SUM(--(FREQUENCY(IF(B2:B9="Yes",MATCH(A2:A9,A2:A9,0)),ROW(A2:A9))>0))
Which is an array entered formula so confirmed through a combination of the keys CtrlShiftEnter
Upvotes: 2
Reputation: 57
I would do this with 2 new columns :
Two formula used :
Upvotes: 0