0

SUMIF with a date condition

I am using this as a condition in a SUMIF formula: Date_IN(Date(@subscription_start, "yyyy-MM-dd HH:mm:ss"), day, -60) and I receive and error the 'day" keyword is unregognised.

My data source presents the date in this format: 2019-03-01 20:31:33 UTC.

 

1 comment

  • 0
    Avatar
    Janice Janczyn

    Hello,

    The DATE_IN function is used to find matches within a time period specified by the 2nd parameter. Your DATE_IN is looking for a match for 1 day, 60 days ago. To look for a match for all dates between 60 days ago and today, use the BETWEEN function:

         BETWEEN( DATE( @subscription_start, "yyyy-MM-dd HH:mm:ss"),  DATE_ADD(TODAY(), day, -59), TODAY() ) 

    Note that you do not type the word 'day' in the DATE_ADD or DATE_IN functions, you select from the pick list that is presented after you type the comma following your first parameter.

    Thank you,
                  Janice

Please sign in to leave a comment.