sum between a range of dates

H

H. Nissen

I have 2 columns. Column A contains 365 rows with dates from 01-01-2008 to
31-12-2008. Column B contains a sum for each day.

I would like to be able to make a total sum of the rows in column B, which
lies between two dates in column A.

For example. from 21-06-2008 to 03-07-2008 = sum.

Sincerely,

H. Nissen
 
B

Bernard Liengme

With the two dates in F1 and F2
a) =SUMIF(A:A,">="&F1,B:B)-SUMIF(A:A,">"&F2,B:B)
b) =SUMPRODUCT(--(A1:A100>=F1),--(A1:A100<=F2),B1:B100)
Note: only XL2007 lets SUMPRODUCT use full column references as in A:A

If you want to enter the actual date in the formula, I recommend
=SUMPRODUCT(--(A1:A100>=DATE(2008,06,21),--(A1:A100<=DATE(2008,07,03),B1:B100)

I have use >= and <= to make both dates inclusive; fix as needed
For more on SUMPRPODUCT see
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html
best wishes
 

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

Top