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?

Current DataSeeking to produce from it
COL ACOL BCOL CCOL DCOL ECOL FCOL GCOL ACOL BCOL CCOL DCOL E
ROW 1Scaffold TypeBridge 1 QTYBridge 1 StartBridge 1 FinishBridge 2 QTYBridge 2 StartBridge 2 Finish ROW 1Scaffold TypeMar-19Apr-19May-19Jun-19
ROW 2Type 12Mar-19Apr-19 ROW 2Type 122
ROW 3Type 24May-19Jun-194Mar-19Jun-19 ROW 3Type 24488
ROW 4Type 31Apr-19May-192Apr-19Jun-19 ROW 4Type 3332
ROW 5Type 49May-19Jun-19 ROW 5Type 499
ROW 6Type 5 ROW 6Type 5
ROW 7 ROW 7

<colgroup><col><col><col span="6"><col><col span="2"><col span="4"></colgroup><tbody>
</tbody>
 

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

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,215,679
Messages
6,126,186
Members
449,296
Latest member
tinneytwin

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