SUMIF formula's for months

mikeywhits

Board Regular
Joined
Jun 7, 2010
Messages
80
Hi all,

I am trying to do an sumif formula based on the following...

I am entering a number of dates into cells A1 - A30 using the format 01/01/11, 06/07/11 etc..

What i want to then do is an IF formula which will search column A1-A30 using the criteria of numerical month for example "01", then adding together all numbers from cells B1-B30 based on this criteria.

Is this possible to do? thanks.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi all,

I am trying to do an sumif formula based on the following...

I am entering a number of dates into cells A1 - A30 using the format 01/01/11, 06/07/11 etc..

What i want to then do is an IF formula which will search column A1-A30 using the criteria of numerical month for example "01", then adding together all numbers from cells B1-B30 based on this criteria.

Is this possible to do? thanks.
Try this...

=SUMPRODUCT(--(MONTH(A1:A30)=1),B1:B30)

When you enter the month number DON'T use the leading 0.

Note that if there are any empty cells within the data range of A1:A30 they will evaluate as month number 1.

In that case then use this version:

=SUMPRODUCT(--(A1:A30<>""),--(MONTH(A1:A30)=1),B1:B30)
 
Upvote 0
Hi Guys,

just realised i need to do this over the period of 2 years so can the above formula be refined to search for the month 01 and year 2011. thanks again.:)
 
Upvote 0
Try

=SUMPRODUCT(--(A1:A30<>""),--(MONTH(A1:A30)=1),--(YEAR(A1:A30)=2011),B1:B30)
 
Upvote 0
Hi Guys,

just realised i need to do this over the period of 2 years so can the above formula be refined to search for the month 01 and year 2011. thanks again.:)
If you're also testing for a specific year then the test for empty cells is not needed (unless you're testing for January 1900).

=SUMPRODUCT(--(MONTH(A1:A30)=1),--(YEAR(A1:A30)=2011),B1:B30)

=SUMPRODUCT(--(TEXT(A1:A30,"myyyy")="12011"),B1:B30)
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,678
Members
452,937
Latest member
Bhg1984

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