How to sum cells in a column that match an End of Month date in an adjacent column

Monty85

Board Regular
Joined
May 6, 2019
Messages
62
Office Version
  1. 365
Platform
  1. Windows
As the title suggests, is there a formula I can build that will Sum values in a column only if they match an End Of Month Date in a different column?

So the determination of the end of month would also need to be automatic and the end result would look something like below (only summing the values in green).

DATEVALUE
10/07/20235
15/07/202310
31/07/202320
15/08/202325
31/08/202350
10/09/202310
30/09/202320
EXPECTED TOTAL90
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi Monty85,

I don't think you can do this in the one column but if you have another column you can:

1722390581755.png


Just make sure the dates in Col. A are actually dates not strings that look dates which considering the dates in your screen shot are left justified they might be.

Regards,

Robert
 
Upvote 0
try

Excel Formula:
=SUM(SUMIF(A2:A8,UNIQUE(DATE(YEAR(A2:A8),MONTH(A2:A8)+1,0)),B2:B8))

1722390976938.png
 
Upvote 0
Thank you
Hi Monty85,

I don't think you can do this in the one column but if you have another column you can:

Just make sure the dates in Col. A are actually dates not strings that look dates which considering the dates in your screen shot are left justified they might be.

Regards,

Robert
try

Excel Formula:
=SUM(SUMIF(A2:A8,UNIQUE(DATE(YEAR(A2:A8),MONTH(A2:A8)+1,0)),B2:B8))

Thank you both. Both these solutions work.
 
Upvote 0
Thank you both. Both these solutions work.

Thanks for letting us know and you're welcome 👌

Excel Formula:
=SUM(SUMIF(A2:A8,UNIQUE(DATE(YEAR(A2:A8),MONTH(A2:A8)+1,0)),B2:B8))

SunnyAlv - very nice 😎
 
Upvote 0
You could also consider this shorter one

24 07 31.xlsm
AB
1DATEVALUE
210/07/20235
315/07/202310
431/07/202320
515/08/202325
631/08/202350
710/09/202310
830/09/202320
990
EOM Sum
Cell Formulas
RangeFormula
B9B9=SUM(B2:B8*(MONTH(A2:A8)<>MONTH(A2:A8+1)))
 
Upvote 0
Hi,

use this formula:

=SUM((DAY(A2:A8)>27)*B2:B8)

in column A must be real date.
 
Upvote 0
use this formula:

=SUM((DAY(A2:A8)>27)*B2:B8)
Unless I have misunderstood this...
build that will Sum values in a column only if they match an End Of Month Date in a different column
.. I don't think that formula will do what is required. In the below example only one date is an End Of Month Date yet your formula adds all the values.

24 07 31.xlsm
AB
1DATEVALUE
228/07/20235
329/07/202310
430/07/202320
530/08/202325
631/08/202350
728/09/202310
829/09/202320
9140
EOM Sum (2)
Cell Formulas
RangeFormula
B9B9=SUM((DAY(A2:A8)>27)*B2:B8)
 
Upvote 0

Forum statistics

Threads
1,223,883
Messages
6,175,167
Members
452,615
Latest member
bogeys2birdies

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