SUM the table using the Criteria and Position

austinandreikurt

Board Regular
Joined
Aug 25, 2020
Messages
91
Office Version
  1. 2016
Platform
  1. Windows
Hi! I need help in trying to sum the values on a table range say it is from A1:B5 based on a criteria. I have a table of criteria in Column P to R like below:

PersonColumnRow
Apple
5​
5​
Orange
1​
1​
Apple
1​
1​

What I need is to get the sum/average values from A1:B5 of all "Apple" based on the column and row specified in Column P to R and it should ignore the blank instances. Say there might be a row for Apple in Column P but no values in Columns Q and R.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi. Sorry if I just post it and trying to put this one up again as I really need it asap. Thanks!
 
Upvote 0
Regret but it shouldn't use any codes and just formula. The expected result is 26 for the sum and average of 13, because the 1st instance is 5th on both row and column which is 25 in the table and 1st on both row and column which is 1.
 
Upvote 0
I misunderstood, sorry. Here's the Table in A1:B5:


1​
2​
3​
4​
5​
6​
7​
8​
9​
10​
11​
12​
13​
14​
15​
16​
17​
18​
19​
20​
21​
22​
23​
24​
25​

So say I put Apple in D1, E1 will put on the sum of all "Apple" based on the Columns and Row number from the A1:B5 table and the average in E2
 
Upvote 0
Regret on this but we are not allowed to make Add-ins and use VBA in here as there are a lot of restrictions. I am not also easily able to make settings in excel unless permitted by admin. :(
 
Upvote 0
Can someone please solve this as I will be using the formula in a larger set of data and my shift is about to end. Thanks
 
Upvote 0
I have to admit I was guessing a lot. I hope it helps:

MrExcel_Sum_the_table_using_the_criteria_and_position.xlsx
PQRSTU
1PersonColumnRowSum 1Sum AllAverage w/o empty
2Apple55252613
3Orange11111
4Apple1112613
5Pea34122814
6Pea28162814
7Apple02613
Tabelle1
Cell Formulas
RangeFormula
S2:S7S2=Q2*R2
T2:T7T2=SUMIF($P$2:$P$7,$P2,$S$2:$S$7)
U2:U7U2=T2/SUMPRODUCT(--($P2=$P$2:$P$7),--($S$2:$S$7>0))
 
Upvote 0
Thanks Sulprobil! Can there be a compound formula without the need for Sum and Sum ALL as there are sheets where I only need the average and will not be making the Sum and Sum All Columns.
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,592
Members
449,089
Latest member
Motoracer88

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