Difficult Riddle: Summing values across various columns and rows

drangel

New Member
Joined
Aug 29, 2014
Messages
18
I am attempting to sum a range (multiple rows and columns) based on multiple criteria (location, type, and if it contains value >=0) in another tab in workbook. I have attempted sumifs, sum(if()), and array formulas but have been unsuccessful.

=SUMIFS('TRUCK Utilization'!P$7:P$367,'TRUCK Utilization'!P$7:P$367,">=0",Table2[TYPE],$B4,Table2[LOCATION],AL$3)
I actually want it to sum ALL values in range P11:AT367 (not just those in row P). When I select/input the entire range I get #Value or 0 and it doesn't sum any...

I want to put in a formula that will sum month to day (running total for the month) availability of truck in the particular location, if its the right type of truck, and if it was available (shown by a value greater than 0).


A Truck Utilization tab tracks the daily usage seen below.

UNIT #Old #TYPEDESCRIPTIONENTITYLOCATIONYEARMODELMoved?FromDate7/17/27/37/47/57/67/77/87/97/107/117/127/137/147/157/167/177/187/197/207/217/227/237/247/257/267/277/287/297/307/31MTD7
1VacuumMidland2005Peterbilt1111111111111111111111111111111

<tbody>
</tbody>


The Truck Summary tab shows the following
Truck Typeson List7/17/27/37/47/57/67/77/87/97/107/117/127/137/147/157/167/177/187/197/207/217/227/237/247/257/267/277/287/297/307/31MTD7Midland
Vacuum-4444444444000000000000000000000400
Available3333333333000000000000000000000300
OOS-Internal1111111111000000000000000000000100



<tbody>
</tbody>
At the far bottom right, you will see "0"s under Midland. I am attempting to calculate by availability (i have the daily formula figured out under the Truck Summary tab by using a sumifs), by location, and by type of truck. I attempted to use the Sumifs formula i have and adding the location range criteria but it returns a "0". It should pull the information from the Truck Utilization tab, right? Anyone have any ideas?


 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Assuming TYPE in column G and LOCATION in column J, see if this does what you need

=SUMPRODUCT(('TRUCK Utilization'!$G$7:$G$367=$B4)*('TRUCK Utilization'!$J$7:$J$367=AL$3)*('TRUCK Utilization'!$P$7:$AT$367>0))

Hope this helps

M.
 
Upvote 0
Assuming TYPE in column G and LOCATION in column J, see if this does what you need

=SUMPRODUCT(('TRUCK Utilization'!$G$7:$G$367=$B4)*('TRUCK Utilization'!$J$7:$J$367=AL$3)*('TRUCK Utilization'!$P$7:$AT$367>0))

Hope this helps

M.



Thank you Marcelo! However, the number it is calculating is not correct when I do sample testing.

On the TRUCK Utilization tab, I would like it to pick up only those values that equal a 0, 1, or 2 (and only count it as 1 if it is has either one of those numbers... right now it is summing those values I believe). Just so you know, the drop-down list in the TRUCK Utilization tab has those three number options as well as other text options (t-out, etc.). I wonder if it is counting some of them as 0 since the equation is looking for figures >0.. I attempted to use ">=0" but an error message pops up....???

Am I still able to sum the many columns (J7:J367) given the two criteria?... I imagine I would have to embed a Countif inside the Sumproduct function in order to count them correct?
 
Upvote 0
Thank you Marcelo! However, the number it is calculating is not correct when I do sample testing.

On the TRUCK Utilization tab, I would like it to pick up only those values that equal a 0, 1, or 2 (and only count it as 1 if it is has either one of those numbers...

See if this does what you need

=SUMPRODUCT(('TRUCK Utilization'!$G$7:$G$367=$B4)*('TRUCK Utilization'!$J$7:$J$367=AL$3)*ISNUMBER(MATCH('TRUCK Utilization'!$P$7:$AT$367,{0;1;2},0)))

M.
 
Upvote 0
See if this does what you need

=SUMPRODUCT(('TRUCK Utilization'!$G$7:$G$367=$B4)*('TRUCK Utilization'!$J$7:$J$367=AL$3)*ISNUMBER(MATCH('TRUCK Utilization'!$P$7:$AT$367,{0;1;2},0)))

M.


Marcelo-

Unfortunately, the formula did not work. I don't understand why it wouldn't work. I also attempted to use OR(0,1,2) instead of {0;1;2}, enclose the ISNUMBER.. in a () but also didn't work/calculate anything. It returns a 0 as the result after inputting the different formulas... Any other ideas?

With regards to the first formula you presented:
=SUMPRODUCT(('TRUCK Utilization'!$E$7:$E$364=$B4)*('TRUCK Utilization'!$H$7:$H$364=AL$3)*('TRUCK Utilization'!$Q$7:$AU$364>0))... It think it was multiplying some of the numbers together.


I also tried
=SUMPRODUCT(('TRUCK Utilization'!$E$7:$E$364=$B4)*('TRUCK Utilization'!$H$7:$H$364=AL$3)*(COUNTIF('TRUCK Utilization'!$Q$7:$AU$364,">0")) and an OR(0,1,2) at the end but was unsuccessful....??
 
Upvote 0
Is hard to know why the formula is not working without seeing your data.

Please, test these formulas

=SUMPRODUCT(('TRUCK Utilization'!$G$7:$G$367=$B4)*('TRUCK Utilization'!$J$7:$J$367=AL$3)*('TRUCK Utilization'!$P$7:$AT$367=0))

=SUMPRODUCT(('TRUCK Utilization'!$G$7:$G$367=$B4)*('TRUCK Utilization'!$J$7:$J$367=AL$3)*('TRUCK Utilization'!$P$7:$AT$367=1))

=SUMPRODUCT(('TRUCK Utilization'!$G$7:$G$367=$B4)*('TRUCK Utilization'!$J$7:$J$367=AL$3)*('TRUCK Utilization'!$P$7:$AT$367=2))

M.
 
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,922
Members
449,094
Latest member
teemeren

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