Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sum data from dates during this year using Google Spreasheets

I have a list of books I've read over the years, along with page counts, stored in Google Spreadsheets.

For each book, I keep a pagecount and the date I finished the book.

I'd like to sum up the pagecounts of all the books I've read this year.

So far, I have this partially incomplete formula:

=SUMIF(EndDate, <Ended reading date is between 2012-1-1 and 2012-12-31 inclusive>, PagesRead)

I'm pretty sure I want to use SUMIF, but I can't figure out how to express the second argument psuedo-code using actual formulas.

Note: I tried the following, but it summed to 0:

=SUMIF(EndDate,AND("<"&DATE(2012,12,31),">"&DATE(2012,1,1)), TotalPages)
like image 399
Jenee Avatar asked Oct 05 '22 12:10

Jenee


1 Answers

Try using sum & filter together. In the following formula, F13:F20 is the data range that I am summing and E13:E20 is the corresponding dates:

    =sum(filter(F13:F20,E13:E20>date(2011,12,31),E13:E20<date(2013,1,1)))
like image 193
chuff Avatar answered Oct 10 '22 03:10

chuff