Formula to sum with criteria from a custom formatted cell

patriot

New Member
Joined
Jan 29, 2009
Messages
26
How do I write a formula that will total "D" for a particular month for a particular year. The spreadsheet has thousands of entries for different years and months. The format for the cells in "C" are custom - "m/d/yyyy h:mm". What would the formula be to total "D" for September 2011? Your help is appreciated.
1CD
2
6/30/2011 12:00:00 AM​
20.00
39/4/2011 5:19:00 PM6.00
49/27/2011 5:19:00 PM8.00
510/1/2011 6:46:00 PM10.00

<tbody>
</tbody>
 
Last edited:
So...what is the most efficient way to fix this formula "=SUMIFS(D:D,C:C,">="&DATE(2012,1,1),C:C,"<="&EOMONTH(DATE(2012,1,1),0))" to include amounts for all of January until 2/1/2012?

If doing that is well motivated...

Either:

=SUMPRODUCT($D$1:$D$16,(INT($C$1:$C$16)-DAY($C$1:$C$16)+1=DATE(2012,1,1))+0)

Or:

=SUMPRODUCT($D$1:$D$16,(INT($C$1:$C$16)-DAY($C$1:$C$16)+1="2012-01-01"+0)+0)

Or, staying with SUMIFS()...

=SUMIFS(D:D,C:C,">="&DATE(2012,1,1),C:C,"<="&EOMONTH(DATE(2012,1,1),0)+1)

If efficiency is a concern, set X2 (or any other cell) to 2012-01-01, and invoke:

=SUMIFS(D:D,C:C,">="&X2,C:C,"<="&EOMONTH(X2,0)+1)
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,215,493
Messages
6,125,119
Members
449,206
Latest member
burgsrus

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