Answer the question
In order to leave comments, you need to log in
Why does Query in Google Spreadsheets return a string that doesn't match the query?
There is a Google table with product sales data containing 2 sheets, on the Daily Sales sheet in column L I want to substitute the value from column P of the Sales Data page, provided that the initial balance (F) = 0, product ID (A) = A and date(O) = C, I got this query:
QUERY('Sales Data'!A:Q; "Select P where (F=0 and A="&A2&" and O="&C2&")")
Answer the question
In order to leave comments, you need to log in
In fact, the formula returns everything correctly - the title of the empty result of its work.
To truncate this header, you need to use the third argument QUERY(;;0)
. Note that if QUERY returns more than one response, then there will be an error. The choice of this formula in these circumstances is unfortunate.
But still, you need to convert the date C2
to the desired format=date '"&TEXT(C2;"yyyy-MM-dd")&"'
=IFNA(
QUERY(
'Sales Data'!A:Q;
"Select P where (F=0 and A="&A2&" and O=date '"&TEXT(C2;"yyyy-MM-dd")&"')";
0
);
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question