0

I have a problem with the query function in Google Sheets.

=QUERY(A1:D7; "Select B where C contains '"& F1 &"' ";0)

These formula works if the cell F1 contains a text or a number. But if it contains a date it turns with a N/A mistake.

table in question

As a result I need to get the data from the column B which is placed in the line with the certain date.

Please, could you help me? What do I do wrong?

player0
  • 124,011
  • 12
  • 67
  • 124
Sanli
  • 77
  • 6

1 Answers1

1

for a date do:

=QUERY(A1:D7; "select B where A = date '"&TEXT(F1; "yyyy-mm-dd")&"'"; 0)

or do:

=ARRAYFORMULA(QUERY(TO_TEXT(A1:D7); "select Col2 where Col1 = '"&F1&"'"; 0))
player0
  • 124,011
  • 12
  • 67
  • 124