please your help

  • Thread starter Thread starter BIRNET
  • Start date Start date
B

BIRNET

How can I use as a criteria dates between a start and end dates in sumif
function.
I wand to sum B cells if dates in A are between 1/1/2009 and 31/3/2009.
 
BIRNET said:
How can I use as a criteria dates between a start and end dates in sumif
function.
I wand to sum B cells if dates in A are between 1/1/2009 and 31/3/2009.

Well, you would write SUMIF(A1:A100,">1/1/2009",B1:B100) -
SUMIF(A1:A100,">=3/31/2009",B1:B100).

(Change to ">=1/1/2009" and ">3/31/2009" if you want to include data for the
start and end dates.)

But I don't know if that is considered "good practice"; generally not.
Moreover, it only works for constant dates.

I would do:

=SUMPRODUCT((A1:A100>DATE(2009,1,1))*(A1:A100<DATE(2009,3,31)),B1:B100)

If the start and end dates are in C1 and C2 respectively:

=SUMPRODUCT((A1:A100>C1)*(A1:A100<C2),B1:B100)
 
Back
Top