Search code examples
google-sheetsgoogle-query-language

date comparision google sheet query


I am using Google-sheets.

I have a Data-table like:

x|A           | B          | C
1|date        |randomNumber|
2| 20.02.2018 | 1243       |
3| 18.01.2018 | 2          |
4| 17.01.2018 | 1          |

and a overview table:

x|A           | B          | C
1|date        |randomNumber|
2| 20.02.2018 |            |
3| 17.01.2018 |            |

I want to lookup the dates on the overview table and lookup their value in my data table. Not every date of the data sheet has to appear in the overview table. All colums are date-formatted.

My approach so far was:

=QUERY(Data ;"select B where A = date '"&TEXT(A2;"yyyy-mm-dd")&"'")

but i get an empty output, which should not be the case, I should get 1243.

Thanks already :)


Solution

  • =ARRAYFORMULA(VLOOKUP(A2:A3;DATA!A1:B4;2;0))