SUM if date is between ...

P

Piotr

Hi is it possible to make such function ?
I need to sum values for records which are invoiced in particular
period of time.

best regards
Peter
 
R

Ron Coderre

Try something like this:


For data in A1:B100 with dates in Col_A and amounts in Col_B

C1: =SUMPRODUCT((A1:A100>=StartDate)*(A1:A100<=EndDate)*(B1:B100))

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 
B

Bernard Liengme

Dates in column A, amounts in column B
=SUMPRODUCT(--(A1:A1000>=DATE(2006,1,1),--(A1:A1000=<DATE(2006,4,30),B1:B1000)
Do not try using entire column as in A:A as SUMPRODUCT does not work with
this.

OR
=SUMIF(A1:A1000,">="&DATE(2006,1,1),B1:B1000)-SUMIF(A1:A1000,">="&DATE(2006,4,30),B1:B1000)
For some reason my XL displayed a date value so I had to format the cell
general.
best wishes
 
D

Don Guillett

where the dates desired are in b1 and b2
=sumproduct((a2:a22>b1)*(a2:a22<=b2)*b2:b22)
 
Top