Sum an array based on a row criteria?

Westie102

New Member
Joined
Feb 3, 2019
Messages
18
Hi everyone,

I hope I explain this well, I'm certain many of you will find this soooo easy...., but I need a bit of guidance, please

I have a spreadsheet similar to the one below. Effectively I want to be able to add up the sum of all of the 'level 1' rows in that range (marked in red) and then separately, all of the level 2's (blue) and then 3's and 4's.


[TABLE="width: 500, align: left"]
<tbody>[TR]
[TD]Level[/TD]
[TD]Date 1[/TD]
[TD]Date 2[/TD]
[TD]Date3[/TD]
[TD]Date 4[/TD]
[TD]Date 5[/TD]
[TD]Date 6[/TD]
[TD]Date 7[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]3[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]4[/TD]
[TD]
[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]2[/TD]
[TD]
[/TD]
[TD]20[/TD]
[TD]20[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD]7[/TD]
[TD]
[/TD]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD]2[/TD]
[TD][/TD]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]6[/TD]
[TD][/TD]
[TD][/TD]
[TD]
[/TD]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]6[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]6[/TD]
[TD]7[/TD]
[TD]
[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]














I think I have to use INDEX and MATCH, but I just can't work out how to get it to add up across the columns.... please point me in the right direction

Thanks in anticipation :)
 

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.
How about


Excel 2013/2016
ABCDEFGHIJ
1LevelDate 1Date 2Date3Date 4Date 5Date 6Date 7
2134338
3222934
44220207
5127748
63124
71165
8433
926672
Sheet1
Cell Formulas
RangeFormula
J2=SUMPRODUCT(($A$2:$A$9=ROW($A1))*($B$2:$H$9))
 
Upvote 0
Oh yes!

I just need to do a little more i think so I can 'pick and choose the level..... but awesome!!!!!!

I might be back, but I'll try to take it from here.... thank-you sooo much!!

very happy indeed.
 
Upvote 0
You're welcome & thanks for the feedback.
If you want to stipulate the level, you could put it in I2 & use
=SUMPRODUCT(($A$2:$A$9=I2)*($B$2:$H$9))
 
Upvote 0
Perhaps not - can you help with the next bit (sorry!)..... I want to be able to specify the level selected (so in $A$1, for example, I type "4" and it gives the result "48", type "3" and it results "7"?

Thanks so much again....

I know I should be able to work this out, just pressured against a deadline and can't for the life of me, work it out!
 
Upvote 0
LOL! You must have read my mind! THANK-YOU!

If I knew who you were, I'd put you on my Christmas card list right now! Thank-you, thank-you, thank-you! :)
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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