Google Sheets – Count Unique Items in QUERY

formulasgoogle sheetsgoogle-sheets-arrayformulagoogle-sheets-queryvlookup

=query(A:B,"Select A, Count(B) where A is not null and B='A' group by A,1")

Best Answer

={"Data", "Count Amount"; 
 ARRAYFORMULA(QUERY({UNIQUE(A3:A), 
 IFERROR(VLOOKUP(UNIQUE(A3:A), 
 QUERY(A:B, "select A,count(B) 
             where A is not null 
               and B='A' 
             group by A 
             label count(B)''", 0), 2, 0), 0)},
 "where Col1 is not null"))}

0