0

I'm using query and import range to get from another sheet. Example

=query(IMPORTRANGE("KEY","Form Responses 1!A:L"), "select * where J = '2020-02-01' ")

I want the where part of the query to be driven from a cell on the current sheet, which contains a date. Something like

=query(IMPORTRANGE("KEY","Form Responses 1!A:L"), "select * where J = A1")

How can I use the value from a cell in the current sheet to drive the import query where?

player0
  • 124,011
  • 12
  • 67
  • 124
Tom
  • 33,626
  • 31
  • 85
  • 109

2 Answers2

1

You can use it on cell reference. You have to set the a1 notaion between: '"& A1 &"'

See this post: QUERY syntax using cell reference

RemcoE33
  • 1,551
  • 1
  • 4
  • 11
1

try:

=QUERY(IMPORTRANGE("KEY", "Form Responses 1!A:L"), "where Col10 = "&DATEVALUE(A1))
player0
  • 124,011
  • 12
  • 67
  • 124