Search code examples
google-sheetsgoogle-query-language

Count non-numeric cells using date in where clause [Google Spreadsheets]


I need to get total of rows when the value column date is in a pre-defined range.

I want to get total of rows when column date is greater or equal than '01/03/2017' and less or equal than '03/03/2017'. (Date is in 'dd/MM/yyyy')

enter image description here


Solution

  • The reference is very helpful.
    QUERY has a date parser, although for this type of purpose I would always recomend using ISO6801 format to avoid day/month ambiguity.

    "SELECT COUNT(A) 
     WHERE 
       toDate(A) >= date '2017-03-01' AND
       toDate(A) <= date '2017-03-03'"