View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default please your help

"BIRNET" wrote:
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:A100DATE(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:A100C1)*(A1:A100<C2),B1:B100)