Sum values before date that changes

kanemitchell99

New Member
Joined
Jul 24, 2018
Messages
7
Office Version
  1. 2021
Platform
  1. Windows
Hi,

Simple task but my brain aint working. I want to sum the total cost before and after a certain date. So if the date is 30/04/2023 sum the total row before this date (should include April month).
When I change the date it should then obviously update the cost.

1708622194040.png
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Upvote 0
Another option :

Excel Formula:
SUM(FILTER(D2:L4,D1:L1<=B1))
Excel Formula:
=SUM(FILTER(D2:L4,D1:L1>B1))
 
Upvote 0
try this:

Book1
ABCDEFGHIJKL
1Today2023-04-30Jan-2023Feb-2023Mar-2023Apr-2023May-2023Jun-2023Jul-2023Aug-2023Sep-2023
2Spend B4323,129096,040018,9990212,873120,74736,349
3Spend Aft1,212,44900227,08956,10100157,710247,362
4000118,08629,416080,816133,990
50096,040227,089193,18629,416212,873359,273417,701
Sheet7
Cell Formulas
RangeFormula
E1:L1E1=EDATE(D1,1)
B2B2=SUMIFS($D$5:$L$5,$D$1:$L$1,"<="&B1)
B3B3=SUMIFS($D$5:$L$5,$D$1:$L$1,">"&B1)
D5:L5D5=SUM(D2:D4)
Thank you. I knew it could be done with SUMIFS but didn't know to properly use the "<="&B1 part. Cheers!
 
Upvote 0

Forum statistics

Threads
1,224,514
Messages
6,179,223
Members
452,896
Latest member
IGT

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