Google-sheets – Google Sheets Using Countifs & Unique Together

formulasgoogle sheetsgoogle-sheets-query

I am trying count the number of unique clients of Payroll service who are Won.

The answer as per the table below should be 4.

enter image description here

How can I achieve this, given that the table will be dynamic?

Best Answer

=COUNTA(UNIQUE(QUERY(A2:C; "select A where B='Payroll' and C='Won'"; 0)))

9