Looking to combine google sheet unique formula with an If formula. See below. The outcome should be Unique values from column "B" and only active values from column "C".

Column B. Column CSweden ActiveSweden ActiveSpain InactiveDenmark InactiveEngland ActiveEngland Active

Preferred outcome

SwedenEngland
4

Best Answer


try:

=UNIQUE(QUERY(B:C, "select B where C = 'Active'", 0))

0

Use

=UNIQUE(FILTER(B:B,C:C="Active"))

enter image description here

Try

=QUERY(UNIQUE(D16:E21),"Select Col1 where Col2='Active'")

Use filter. Sample Usage:

FILTER(A2:B26, A2:A26 > 5, D2:D26 < 10)

FILTER(A2:C5, {TRUE; TRUE; FALSE; TRUE})

FILTER(A2:B10, NOT(ISBLANK(A2:A10)))

https://support.google.com/docs/answer/3093197?hl=en