=COUNTA(IFERROR(QUERY(IMPORTRANGE("Sheet1","QC sheet!A792:B10000"), "Select Col2, Col4 where Col2 contains '"&B$1&"' and Col4 contains '"&C1&"' and date "&TEXT(G1,"'YYY-MM-DD'")&" <=Col1 and date "&TEXT(H1,"'YYY-MM-DD'")&" >=Col1" ,0)))
Using above formula to count data with 2 containing conditions along with start and end date does not work.
EDIT 1:
https://drive.google.com/file/d/1DTMFViXxBn-ezPJ2Njjbor-4udoRyc8M/view?usp=sharing
Please update the formula sheet have been attached.
Edit 2:
=COUNTIFS(D3:D50,A1,E3:E50,B1,C3:C50,">0",C3:C50,F1,C3:C50,G1)
This formula is working but how we can calculate same with query formula actually i have to get data by importrange.
Best Answer
Basically there are two mistakes in your query formula.
IMPORTRANGE("Sheet1","QC sheet!A792:B10000")
can not return anything. The reason being that you need to replace theSheet
part of the formula with the sheet'sID
that you want to import from. (More info aboutIMPORTRANGE
)Col4
when you import just 2 columnsA
andB
fromsheet!A792:B10000
.(More info about
QUERY
)I do not know about the rest of it (no obvious mistakes) since I cannot access your sheet.
(Please read how to share a Google spreadsheet so as you can be easier helped.)
Correct the formula, see if it works for you and let us know.