How to sum multiple column values based on multiple date ranges and resolve into date range summary?

Makehoe

New Member
Joined
Jan 1, 2019
Messages
2
Hi excel help community,

I have a sheet that collects our planned scaffold tower quantities by type for each bridge we have with an associated date range of use.

I would like to sum scaffold type in use by month (see below) to enable us to produce a histogram of scaffold type over several years.

As we have 30 bridges over many years, I'm trying to avoid multiple nested if functions.

What is the most efficient formula to rationalize the data?

[TABLE="width: 1117"]
<colgroup><col><col><col span="6"><col><col span="2"><col span="4"></colgroup><tbody>[TR]
[TD="colspan: 8"]Current Data[/TD]
[TD][/TD]
[TD="colspan: 6"]Seeking to produce from it[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]COL A[/TD]
[TD]COL B[/TD]
[TD]COL C[/TD]
[TD]COL D[/TD]
[TD]COL E[/TD]
[TD]COL F[/TD]
[TD]COL G[/TD]
[TD][/TD]
[TD][/TD]
[TD]COL A[/TD]
[TD]COL B[/TD]
[TD]COL C[/TD]
[TD]COL D[/TD]
[TD]COL E[/TD]
[/TR]
[TR]
[TD] ROW 1[/TD]
[TD]Scaffold Type[/TD]
[TD]Bridge 1 QTY[/TD]
[TD]Bridge 1 Start[/TD]
[TD]Bridge 1 Finish[/TD]
[TD]Bridge 2 QTY[/TD]
[TD]Bridge 2 Start[/TD]
[TD]Bridge 2 Finish[/TD]
[TD][/TD]
[TD] ROW 1[/TD]
[TD]Scaffold Type[/TD]
[TD="align: right"]Mar-19[/TD]
[TD="align: right"]Apr-19[/TD]
[TD="align: right"]May-19[/TD]
[TD="align: right"]Jun-19[/TD]
[/TR]
[TR]
[TD] ROW 2[/TD]
[TD]Type 1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]Mar-19[/TD]
[TD="align: right"]Apr-19[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] ROW 2[/TD]
[TD]Type 1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] ROW 3[/TD]
[TD]Type 2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]May-19[/TD]
[TD="align: right"]Jun-19[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]Mar-19[/TD]
[TD="align: right"]Jun-19[/TD]
[TD][/TD]
[TD] ROW 3[/TD]
[TD]Type 2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD] ROW 4[/TD]
[TD]Type 3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]Apr-19[/TD]
[TD="align: right"]May-19[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]Apr-19[/TD]
[TD="align: right"]Jun-19[/TD]
[TD][/TD]
[TD] ROW 4[/TD]
[TD]Type 3[/TD]
[TD][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD] ROW 5[/TD]
[TD]Type 4[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]May-19[/TD]
[TD="align: right"]Jun-19[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] ROW 5[/TD]
[TD]Type 4[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD] ROW 6[/TD]
[TD]Type 5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] ROW 6[/TD]
[TD]Type 5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] ROW 7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] ROW 7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi

Can you use this?

It seems to produce the correct results but will be harder to implement if you have 30 bridges of data spanning across your sheet.


Book1
ABCDEFG
1Scaffold TypeBridge 1 QTYBridge 1 StartBridge 1 FinishBridge 2 QTYBridge 2 StartBridge 2 Finish
2Type 12Mar-19Apr-19
3Type 24May-19Jun-194Mar-19Jun-19
4Type 31Apr-19May-192Apr-19Jun-19
5Type 49May-19Jun-19
6Type 5
7
8Mar-19Apr-19May-19Jun-19
9Type 122
10Type 2448
11Type 3312
12Type 499
13Type 5
Sheet1
Cell Formulas
RangeFormula
C8=EOMONTH(B8,0)+1
D8=EOMONTH(C8,0)+1
E8=EOMONTH(D8,0)+1
B9=SUMPRODUCT(($A$2:$A$6=$A9)*($C$2:$D$6>=B$8)*($C$2:$D$6<=EOMONTH(B$8,0))*$B$2:$B$6)+SUMPRODUCT(($A$2:$A$6=$A9)*($E$2:$G$6>=B$8)*($E$2:$G$6<=EOMONTH(B$8,0))*$E$2:$E$6)
 
Last edited:
Upvote 0
Thanks RasGhul, however it'll be a very long string for the 30 bridges producing it this way.

Can anyone advise a neat solution?
 
Upvote 0
Hi Make,

Does the scaffold types exceed 5?

Also does the Bridge qty/start/finish repeat for all 30 bridges?
 
Upvote 0
Another possible solution is to transpose your data and convert your bridges table so that you can use a much smaller sumifs formula. This can be setup on the same sheet or a different sheet.

Mock up sheet link below with 30 bridges and calendar year. The calendar months are dynamic by entering the start date of the new year start.

Note to avoid deleting rows in your Bridges data as the transpose formula will result in an error.


https://www.dropbox.com/s/1lmkzox3r3ewa9u/sum multiple columns_and date ranges_2_makehoe.xlsx?dl=0
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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