Sum Data By Month & Year

craigs23

Board Regular
Joined
Apr 25, 2012
Messages
65
Hi Everyone,

I have searched the forums for an answer to this but to no avail.

I am hoping someone may be able to help me, basically I amtrying to produce a formula that will sum daily data by Month and year.

i.e: if Column A lists dates by day (01/01/2011 through to 25/04/2012)
and Column B lists a number (eg qty of parts).

What I want do is then have seperate cells for each month Say in Column C (i.e Jan 2011-Apr2012) then in the next column have a formula that will basically return a total figure from Coulmn B for the relevant month.

Any help you may be able to offer will be gratefully recieved.

thanks

Craig
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try:

=SUMPRODUCT((MONTH(A1:A100)=4)*(B1:B100))

.. where dates are in range A1:A100 and values are in range B1:B100 this will give you the total of April (MONTH() = 4).
 
Upvote 0
With month number (1 for January) in C1 and year (e.g. 2011) in D1 try

=SUMPRODUCT(--(MONTH(A1:A100)=C1),--(YEAR(A1:A100)=D1),B1:B100)
 
Upvote 0
Hi Guys,

Thanks for your quick response, WintE your solution worked up to a point but thanks anyway.
VoG Your solution was exactley what I was looking for, Thank you!!

One more question in VoG's formula what is the function of the hyphons?eg SUMPRODUCT(--(
I am fairly new to this level of formula but am trying to lear as much as possible, while it is fantastic that people on the forum can offer solutions I would really like to try and understand what the formulas/codes are actually doing so any help is appreciated.

Once again Thanks for the quick repsonse guys!!
 
Upvote 0
Hi,
I try SUMPRODUCT for sum data by month and year but it just shows #VALUE :

=SUMPRODUCT(--(Table1[[#All],[Date issue]]=A2),--(MONTH(Table1[[#All],[Date]])=MONTH(B2)),--(YEAR(Table1[[#All],[Date]])=YEAR(B2)),(Table1[[#All],[Total]]))
=SUMPRODUCT((Table1[[#All],[Date issue]]=A2)*(MONTH(Table1[[#All],[Date]])=MONTH(B2))*(YEAR(Table1[[#All],[Date]])=YEAR(B2))*(Table1[[#All],[Total]]))

Anyone please help
 
Upvote 0

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

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