ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Adding in a Date Range (https://www.excelbanter.com/excel-worksheet-functions/169999-adding-date-range.html)

readystate

Adding in a Date Range
 
I have a worksheet with a Date Column. I want to include a formula that will
add, for example, amounts for the month of February 2008. How would I set
that up? Thanks in advance.

Pete_UK

Adding in a Date Range
 
Assume your dates are in column A and you want to add amounts from
column B - assume 1000 rows are used. To make it more flexible, put
the date you are searching for in C1 (formatted as mmmm yyyy - the day
doesn't matter), then put this formula in D1:

=SUMPRODUCT((MONTH(A$1:A$1000)=MONTH(C1))*(YEAR(A$ 1:A
$1000)=YEAR(C1))*(B$1:B$1000))

Hope this helps.

Pete

On Dec 17, 5:09 pm, readystate
wrote:
I have a worksheet with a Date Column. I want to include a formula that will
add, for example, amounts for the month of February 2008. How would I set
that up? Thanks in advance.



Mike H

Adding in a Date Range
 
Hi,

When summing in this way it's a good idea to keep the date to sum outside of
the formula so with 1/2/2008 in C1 the day of the monthe can be any

=SUMPRODUCT(--(YEAR(A1:A20)=YEAR(C1)),--(MONTH(A1:A20)=MONTH(C1)),B1:B20)

This will add up coolumn B for every Feb 2008 in column A1 - A20

Mike

"readystate" wrote:

I have a worksheet with a Date Column. I want to include a formula that will
add, for example, amounts for the month of February 2008. How would I set
that up? Thanks in advance.


readystate

Adding in a Date Range
 
Thanks...worked great!!!

"Mike H" wrote:

Hi,

When summing in this way it's a good idea to keep the date to sum outside of
the formula so with 1/2/2008 in C1 the day of the monthe can be any

=SUMPRODUCT(--(YEAR(A1:A20)=YEAR(C1)),--(MONTH(A1:A20)=MONTH(C1)),B1:B20)

This will add up coolumn B for every Feb 2008 in column A1 - A20

Mike

"readystate" wrote:

I have a worksheet with a Date Column. I want to include a formula that will
add, for example, amounts for the month of February 2008. How would I set
that up? Thanks in advance.


Roger Govier[_3_]

Adding in a Date Range
 
Hi

One way, assuming your dates are in column A and values in column B

=SUMPRODUCT((TEXT($A$1:$A$1000,"yymm")="0802")*($B $1:$B$1000))

--

Regards
Roger Govier

"readystate" wrote in message
...
I have a worksheet with a Date Column. I want to include a formula that
will
add, for example, amounts for the month of February 2008. How would I set
that up? Thanks in advance.




All times are GMT +1. The time now is 06:19 AM.

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