Home > Enterprise >  There is 4unique color in column G3:G. I need a formula to count the unique value of G3:G and show i
There is 4unique color in column G3:G. I need a formula to count the unique value of G3:G and show i

Time:08-20

enter link description hereI have used =if(b3:b="","",sumif(SUMIF(H3:H,H3:H,Q3:Q))) in S3:S. Now I want to use a formula in column P3:P that will count unique value of column G3:G. I have tried =IF(B3="","",COUNTA(UNIQUE(G3:G))) But it's showing wrong output.

CodePudding user response:

=COUNTA(QUERY(B:G, "SELECT G WHERE B is NULL"))

QUERY function will return all cells from column G where A is blank. COUNTA will count all of the values returned by QUERY.

Let me know if that is what you need.

CodePudding user response:

You need Group By clause to query function. Try-

=QUERY(B3:G,"select G, count(G) where B is not null group by G label count(G) ''")

CodePudding user response:

maybe:

=IF(B3<>"", COUNTA(UNIQUE(G$3:G)))

(share a copy / sample of your sheet with an example of the desired output)

  • Related