ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   please your help (https://www.excelbanter.com/excel-worksheet-functions/234318-please-your-help.html)

BIRNET

please your help
 
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.


joeu2004

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)



All times are GMT +1. The time now is 08:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com