Sum Daily Amounts to Monthly

DeanR

New Member
Joined
Feb 6, 2006
Messages
12
Here is the data. Below the data is what I want to do.


Date......... Amount

01/01/2009 125
01/02/2009 283
01/03/2009 632
etc.
12/31/2009 396


I want to calculate the totals for each month at the bottom of the data.

01/2009 xxx Total
02/2009 xxx Total
etc.
12/2009 xxx Total


I have tried the SUMIF function, but it either does not work or I have the wrong syntax.

=SUMIF(A1:A365,AND(">=1/1/2009","<=1/31/2009"),B1:B365)

It would be better for the criteria to be a reference to the month and year in column A instead of AND(">=1/1/2009","<=1/31/2009").


Thanks for your help and expertise.

Dean
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
I tried the following SUMIF function and it did not work. That is, the result is zero.

=SUMIF(A1:A365,AND(">="&DATE(YEAR(A367),MONTH(A367),1),"<="&DATE(YEAR(A367),MONTH(A367),31)),B1:B365)


However, if I take the AND out of the formula and SUMIF is based on date greater than 1/1/2009 the formula works. It is not the result I want, but the formula works. I must not have the AND syntax and/or logic correct.

=SUMIF(A1:A365,">="&DATE(YEAR(A367),MONTH(A367),1),B1:B365)


Dean
 
Upvote 0
I read in an Excel book that you can not use the AND function in an array formula.

I assume that the SUMIF function is a type of array formula.


-Dean
 
Upvote 0
Sumproduct will work in this case:

=SUMPRODUCT((MONTH($A$1:$A$365)=MONTH(A367))*$B$1:$B$365)
 
Upvote 0
Thanks for suggesting SUMPRODUCT function as a solution. Now I will need to stretch my brain to understand how this function works.

I will test to see if this function will also work for selecting month and year as a summing criteria.

-Dean
 
Upvote 0
Thanks for suggesting SUMPRODUCT function as a solution. Now I will need to stretch my brain to understand how this function works.

I will test to see if this function will also work for selecting month and year as a summing criteria.

-Dean

Hi DeanR
did you have any success with month&year as sum criteria?
I would need something like that...all help needed.

BR Gasper
 
Upvote 0
Pivottable grouped by years and months

Hello,

why don't you use PivotTable grouped by years and months?:
Excel Workbook
ABCDEF
1DateValue*Summe von Value**
202.09.2009230,90*JahreDateErgebnis
320.05.2009390,58*2009Jan2.403,42
429.12.2009776,89**Feb3.755,13
520.01.2009874,82**Mrz2.376,12
613.05.2009807,52**Apr2.831,88
726.10.2009687,34**Mai8.438,01
827.03.2009265,47**Jun3.961,45
924.11.2009562,24**Jul4.439,21
1014.07.200912,49**Aug4.419,18
1103.11.2009660,86**Sep4.064,66
1219.09.2009937,04**Okt1.626,54
1305.10.2009368,57**Nov4.698,98
1419.10.200991,09**Dez3.164,05
1526.05.2009328,21****
1623.02.2009879,75****
1722.03.2009974,45****
1814.11.2009659,31****
1903.06.2009983,36****
2009.11.2009211,91****
Sheet


I'm using german excel, that's why dates and values of my example have the wrong format.
 
Upvote 0
I have not had a chance to test if MONTH and YEAR will work with SUMPRODUCT function.

Pivot Table is probably a solution. However, I would prefer a method that displays the monthly sums below my existing data that is relatively easy to accomplish, easy for someone to understand the displayed results, and easy for another user to follow the methodology so that they can update the spreadsheet.

-Dean
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,760
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top