Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Google Sheets Sumif

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading