sumproduct with dates

G

Guest

I have a quarterly time series and I always want to sum the last three
quartes of a year and the first of the next year and I can't think of a
simple way to do it.
e.g.
A B
31/3/2005 1000
30/6/2005 3500
30/9/2005 6790
31/12/2005 8000
31/3/2006 9000

So I would want to add quarters 6, 9 and 12 of 2005 and 3 of 2006 in this
case but in general quarters 6, 9, 12 of year xxxx and 3 of year xxxx+1
 
G

Guest

with year in C1 i.e. 2005:

=SUMPRODUCT(--(MONTH(A1:A5)>3),--(YEAR(A1:A5)=C1),(B1:B5))+SUMPRODUCT(--(MONTH(A1:A5)=3),--(YEAR(A1:A5)=C1+1),(B1:B5))

HTH
 
G

Guest

with year in C1 i.e. 2005:

=SUMPRODUCT(--(MONTH(A1:A5)>3),--(YEAR(A1:A5)=C1),(B1:B5))+SUMPRODUCT(--(MONTH(A1:A5)=3),--(YEAR(A1:A5)=C1+1),(B1:B5))

HTH
 
G

Guest

thank you, it worked

Toppers said:
with year in C1 i.e. 2005:

=SUMPRODUCT(--(MONTH(A1:A5)>3),--(YEAR(A1:A5)=C1),(B1:B5))+SUMPRODUCT(--(MONTH(A1:A5)=3),--(YEAR(A1:A5)=C1+1),(B1:B5))

HTH
 
G

Guest

thank you, it worked

Toppers said:
with year in C1 i.e. 2005:

=SUMPRODUCT(--(MONTH(A1:A5)>3),--(YEAR(A1:A5)=C1),(B1:B5))+SUMPRODUCT(--(MONTH(A1:A5)=3),--(YEAR(A1:A5)=C1+1),(B1:B5))

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

IF Function with Dates 9
Excel date intervals look up 1
IF Dates 1
help with Sum in between dates 9
Date Sorting 2
If statements?? 2
Yearly sum 3
IRR & XIRR - Different Results 10

Top