Google-sheets – How to add a criterion to the data range in a Query

google sheetsgoogle-sheets-query

I have this formula:

=ArrayFormula(QUERY({'LEADs oGV'!U:U,'LEADs oGV'!U:U},"select Col1, count(Col2) where Col2 IS NOT NULL group by Col1 order by count(Col2) desc limit 3",0))

The data range is currently the whole column U in the LEADs oGV sheet.

I want it to be all items in column U which have the cell value DONE in Column B.

How would I change the original formula?

Best Answer

Not sure what you are aiming for but suggest:

=QUERY('LEADs oGV'!B:U,"select U, count(U) where U IS NOT NULL and B = 'done' group by U order by count(U) desc limit 3",0)