Sum Data Across Columns and Rows between Dates

ChetanPuri

Board Regular
Joined
Sep 5, 2018
Messages
97
Office Version
  1. 365
Platform
  1. Windows
Hello Excel Team,
Just need help with a Sum formula to calculate the data on to Budget tab from July 2024-2025 (Source Sheet). The issue I get is that I have dates from Row I8 to Column BH 8. The Starting Date is 07 July 2023 and ends on 30 June 2024 and similarly I have data from I 9 to BH 135. On to my Budget Sheet I need to add the Data by Month End for Example Total Sales Revenue in July, August, Sep etc. I have included both the sheets below the 1st Sheet (Budget) that's where I want the Revenue by Month and second sheet is the source sheet which have the data by week.

Any help is appreciated.


Book5
ABCDEFGHIJKLMNO
2Monthly Trial Balance - Budget
3© www.excel-skills.com.au------------
4ClassAcc NoAccount DescriptionJul-2023Aug-2023Sep-2023Oct-2023Nov-2023Dec-2023Jan-2024Feb-2024Mar-2024Apr-2024May-2024Jun-2024
5I-01GIS-0105Revenue- 216,600.00- 433,200.00- 649,800.00- 866,400.00- 1,083,000.00- 1,299,600.00- 1,516,200.00- 1,732,800.00- 1,949,400.00- 2,166,000.00- 2,382,600.00- 2,599,200.00
6
7
8
Budget
Cell Formulas
RangeFormula
D4D4=DATE(YEAR('[CP Budget Workbook3.xlsx]Setup'!$C$10)-1,MONTH('[CP Budget Workbook3.xlsx]Setup'!$C$10)+2,0)
E4:O4E4=DATE(YEAR(D4),MONTH(D4)+2,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4Expression=COUNTIF(BudClass,"No key!")>0textYES
D3:O3Expression=ROUND(D3,2)<>0textYES



Book5
IJKLMNOPQRSTUVWXYZAAAB
807-Jul-2314-Jul-2321-Jul-2328-Jul-2304-Aug-2311-Aug-2318-Aug-2325-Aug-2301-Sep-2308-Sep-2315-Sep-2322-Sep-2329-Sep-2306-Oct-2313-Oct-2320-Oct-2327-Oct-2303-Nov-2310-Nov-2317-Nov-23
93,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.983,015.98
10
112,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.002,634.00
125,007.995,007.995,007.995,007.995,007.995,007.995,007.995,007.995,007.995,007.995,007.995,007.992,861.71
132,146.285,007.995,007.995,007.995,007.995,007.995,007.995,007.99
143,931.992,808.56
151,123.433,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.993,931.99
1613,236.4713,236.4713,236.4713,236.4713,236.4713,236.4713,236.4713,236.4713,236.4713,236.477,563.70
175,387.2512,570.2512,570.2512,570.2512,570.2512,570.2512,570.2512,570.2512,570.2512,570.25
186,203.596,203.596,203.596,203.596,203.596,203.596,203.596,203.596,203.596,203.593,544.91
192,658.686,203.596,203.596,203.596,203.596,203.596,203.596,203.596,203.596,203.59
205,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.855,738.85
217,101.607,101.607,101.607,101.607,101.607,101.607,101.607,101.607,101.607,101.607,101.605,072.57
222,029.037,101.607,101.607,101.607,101.607,101.607,101.607,101.607,101.60
237,963.527,963.527,963.527,963.527,963.527,963.527,963.527,963.527,963.527,963.527,963.527,963.527,963.527,963.523,412.94
244,531.757,930.567,930.567,930.567,930.567,930.56
256,181.186,181.186,181.186,181.186,181.186,181.186,181.186,181.186,181.186,181.186,181.186,181.184,415.13
Revenue July 2024-2025
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I8:BH8Expression=$I$8>#REF!textNO
 
Okay, try this:

I suggest posting these into a new workbook first to get the proof of concept established. If it works then, then you have what you need to do.


Cell Formulas
RangeFormula
E4:O4E4=EDATE(D4,1)
D5:O8D5=LET( Data,'Revenue July 2024-2025'!$D$9:$L$43, AccNos,'Revenue July 2024-2025'!$B$9:$B$43, Dates,'Revenue July 2024-2025'!$D$8:$L$8, AccNo,$B5, TargetFOM,EOMONTH(D$4,-1)+1, TargetEOM,EOMONTH(D$4,0), SUMPRODUCT((TargetFOM<=Dates)*(TargetEOM>=Dates)*(Data)*(AccNo=AccNos)))
P5:P8P5=SUM(D5:O5)





Book1
ABCDEFGHIJKLM
1
2
3
4
5
6
7
8Account No.Region2024-07-052024-07-122024-07-192024-07-262024-08-022024-08-092024-08-162024-08-232024-08-30
920.23.140.401Palmerston3,386.903,386.903,386.903,386.903,386.903,386.903,386.903,386.903,386.90
1020.23.140.401Palmerston
11
1220.23.100.401Darwin2,781.062,781.062,781.062,781.062,781.062,781.062,781.062,781.062,781.06
1320.23.100.401Darwin
14
1520.23.110.401Katherine5,273.415,273.415,273.415,273.415,273.415,273.415,273.415,273.415,273.41
1620.23.110.401Katherine
17
1820.23.100.401Darwin4,151.534,151.53
1920.23.100.401Darwin593.084,151.534,151.534,151.534,151.534,151.534,151.534,151.53
20
2120.23.100.401Darwin13,272.1113,272.1113,272.1113,272.1113,272.1113,272.1113,272.1113,272.1113,272.11
2220.23.100.401Darwin
23
2420.23.140.401Palmerston6,532.386,532.386,532.386,532.386,532.386,532.386,532.386,532.386,532.38
2520.23.140.401Palmerston
26
2720.23.140.401Palmerston6,059.286,059.286,059.286,059.286,059.286,059.286,059.286,059.286,059.28
2820.23.140.401Palmerston
29
3020.23.140.401Palmerston7,477.987,477.987,477.987,477.987,477.987,477.987,477.987,477.987,477.98
3120.23.140.401Palmerston
32
3320.23.100.401Darwin8,350.888,350.888,350.888,350.888,350.888,350.888,350.888,350.888,350.88
3420.23.100.401Darwin
35
3620.23.100.401Darwin4,853.334,853.334,853.334,853.334,853.334,853.334,853.334,853.334,853.33
3720.23.100.401Darwin
38
3920.23.140.401Palmerston3,894.673,894.673,894.673,894.673,894.67556.38
4020.23.140.401Palmerston3,894.673,894.673,894.673,894.67
41
4220.23.140.401Palmerston6,043.836,043.836,043.836,043.836,043.836,043.836,043.836,043.836,043.83
4320.23.140.401Palmerston
Revenue July 2024-2025
Thank you for all your effort, I tried establishing the new worksheet and still get the error.
 
Upvote 0

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Thank you for all your help, it works perfectly. Many thanks, Regards, Chetan
 
Upvote 0
What did you do differently? On my source sheet for the Data I had if error Formula to leave it Blank, I changed it "0" and it worked perfectly fine
Cell Formulas
RangeFormula
D4D4=DATE(YEAR(Setup!$C$10)-1,MONTH(Setup!$C$10)+2,0)
E4:N4E4=DATE(YEAR(D4),MONTH(D4)+2,0)
D40:N43D40=LET(Data,'SIL- Participant Budget Working'!$R$9:$BQ$147,AccNos,'SIL- Participant Budget Working'!$F$9:$F$147,Dates,'SIL- Participant Budget Working'!$R$8:$BQ$8,AccNo,Budget!$B40,TargetFOM,EOMONTH(Budget!D$4,-1)+1,TargetEOM,EOMONTH(Budget!D$4,0),SUMPRODUCT((TargetFOM<=Dates)*(TargetEOM>=Dates)*(Data)*(AccNo=AccNos)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A4Expression=COUNTIF(BudClass,"No key!")>0textYES
D3:O3Expression=ROUND(D3,2)<>0textYES
 
Upvote 0
Okay, so based on the information I had available, did the suggestion I made work?
 
Upvote 0
you're welcome. But, I don't understand how you got errors with an absolutely clean workbook. I had no other data to cause errors.
 
Upvote 0
you're welcome. But, I don't understand how you got errors with an absolutely clean workbook. I had no other data to cause errors.
you're welcome. But, I don't understand how you got errors with an absolutely clean workbook. I had no other data to cause errors.
Because the source sheet I shared with you had no formulas, it was just copy and paste where as my original file had formulas such as if error which you will notice, I have changed to 0 instead of ""
Cell Formulas
RangeFormula
S8:X8S8=R8+7
R9:X21R9=IFERROR(($P9/$Q9)*((1/(1/(MEDIAN(MIN($L9,$C$2+7),R$8-1,R$8+6)-MEDIAN(MAX($K9,$C$1)-1,R$8-1,R$8+6))))/7),"0")
P9:P21P9=IF(K9<J9,O9*(1+$C$3),O9)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
R8:BQ8Expression=$R$8>$C$2textNO
 
Upvote 0
OK. I still don't understand. I asked you to confirm the formula works with only the data and formulas I had posted. You said it failed.
Regardless, you figured it out.

Best wishes.
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,136
Members
453,021
Latest member
Justyna P

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