Trying to use sumif to get total for column "E" based on Date (number) in column "C"
=sumif(C1:C51,="AND(C1>=45047,C1<=45077)",E1:E51) creates error message "Formula parse error".
Column C1:C51 are dates formatted as MMM-DD rather than a number
(45047 – 45077 are May dates)
Column E is numeric values
>Solution :
The correct syntax for the SUMIF formula, in this case, would be:
=SUMIF(C1:C51,">=45047",E1:E51)-SUMIF(C1:C51,">45077",E1:E51)
This formula sums the values in column E where the corresponding date in column C is greater than or equal to 45047 (May 1, 2021) and less than or equal to 45077 (May 31, 2021).
Note that the dates in column C are formatted as MMM-DD, but Google Sheets recognizes them as dates and converts them to numbers internally. Therefore, we can use the numeric values directly in the formula.
Also, the AND function is not needed in this case, as we are only checking for a single condition (the date range).