SUM Text based on another column

JackRegan

New Member
Joined
Sep 20, 2021
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
Hi

Trying to turn a bunch of A-D ratings into numerical results (without a helper column) based on other data in the table.

A=4, B=3, C=2, D=2

In laymans

If control = blue then calculate [BASIC|STANDARD|EXTREME|HAWKINS] category score.​

Control & Category are fixed and Rating will always be A-D.
A control will always have one of the categories

CONTROLCATEGORYRATING
BLUEBASICC
BLUESTANDARDA
BLUEBASICA
ORANGEHAWKINSB
ORANGEEXTREMED
ORANGEBASICC
PINKSTANDARDC
PINKHAWKINSB
PINKBASICA
BASIC TOTAL - BLUE
STANDARD TOTAL - BLUE
EXTREME TOTAL - BLUE
HAWKINS TOTAL - BLUE
BASIC TOTAL - ORANGE
STANDARD TOTAL - ORANGE
EXTREME TOTAL - ORANGE
HAWKINS TOTAL - ORANGE
BASIC TOTAL - PINK
STANDARD TOTAL - PINK
EXTREME TOTAL - PINK
HAWKINS TOTAL - PINK

Example :
BASIC BLUE TOTAL = C,A,[2,4] = 6

Not sure I have done a great job of explaining ... but welcome any input.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
How about
+Fluff 1.xlsm
ABC
1CONTROLCATEGORYRATING
2BLUEBASICC
3BLUESTANDARDA
4BLUEBASICA
5ORANGEHAWKINSB
6ORANGEEXTREMED
7ORANGEBASICC
8PINKSTANDARDC
9PINKHAWKINSB
10PINKBASICA
11
12BlueBasic6
13BlueStandard4
14BlueExtreme0
15BlueHawkins0
16
17OrangeBasic2
18OrangeStandard0
19OrangeExtreme1
20OrangeHawkins3
21
22PinkBasic4
23PinkStandard2
24PinkExtreme0
25PinkHawkins3
Lists
Cell Formulas
RangeFormula
C12:C15,C22:C25,C17:C20C12=SUMPRODUCT(($A$2:$A$10=A12)*($B$2:$B$10=B12)*(SWITCH($C$2:$C$10,"A",4,"B",3,"C",2,"D",1)))
 
Upvote 0
Hi, here's another option you could try.

Book7
ABC
1CONTROLCATEGORYRATING
2BLUEBASICC
3BLUESTANDARDA
4BLUEBASICA
5ORANGEHAWKINSB
6ORANGEEXTREMED
7ORANGEBASICC
8PINKSTANDARDC
9PINKHAWKINSB
10PINKBASICA
11
12BlueBasic6
13BlueStandard4
14BlueExtreme0
15BlueHawkins0
16
17OrangeBasic2
18OrangeStandard0
19OrangeExtreme1
20OrangeHawkins3
21
22PinkBasic4
23PinkStandard2
24PinkExtreme0
25PinkHawkins3
Sheet1
Cell Formulas
RangeFormula
C22:C25,C17:C20,C12:C15C12=SUMPRODUCT(COUNTIFS($A$2:$A$10,A12,$B$2:$B$10,B12,$C$2:$C$10,{"A","B","C","D"}),{4,3,2,1})
 
Upvote 0
Solution
Thank you!

Working as an example but struggling to apply it to my data. Tables, and data across sheets seem to be causing it so will wind it all back .. But the formula works.

Paul
 
Upvote 0
To run it over 2 sheets you need to add the sheet name like
+Fluff 1.xlsm
ABC
1CONTROLCATEGORYRATING
2BLUEBASICC
3BLUESTANDARDA
4BLUEBASICA
5ORANGEHAWKINSB
6ORANGEEXTREMED
7ORANGEBASICC
8PINKSTANDARDC
9PINKHAWKINSB
10PINKBASICA
Sheet1


+Fluff 1.xlsm
ABC
1
2BlueBasic6
3BlueStandard4
4BlueExtreme0
5BlueHawkins0
6
7OrangeBasic2
8OrangeStandard0
9OrangeExtreme1
10OrangeHawkins3
11
12PinkBasic4
13PinkStandard2
14PinkExtreme0
15PinkHawkins3
Lists
Cell Formulas
RangeFormula
C2:C5,C12:C15,C7:C10C2=SUMPRODUCT((Sheet1!$A$2:$A$10=A2)*(Sheet1!$B$2:$B$10=B2)*(SWITCH(Sheet1!$C$2:$C$10,"A",4,"B",3,"C",2,"D",1)))
 
Upvote 0
To run it over 2 sheets you need to add the sheet name like
+Fluff 1.xlsm
ABC
1CONTROLCATEGORYRATING
2BLUEBASICC
3BLUESTANDARDA
4BLUEBASICA
5ORANGEHAWKINSB
6ORANGEEXTREMED
7ORANGEBASICC
8PINKSTANDARDC
9PINKHAWKINSB
10PINKBASICA
Sheet1


+Fluff 1.xlsm
ABC
1
2BlueBasic6
3BlueStandard4
4BlueExtreme0
5BlueHawkins0
6
7OrangeBasic2
8OrangeStandard0
9OrangeExtreme1
10OrangeHawkins3
11
12PinkBasic4
13PinkStandard2
14PinkExtreme0
15PinkHawkins3
Lists
Cell Formulas
RangeFormula
C2:C5,C12:C15,C7:C10C2=SUMPRODUCT((Sheet1!$A$2:$A$10=A2)*(Sheet1!$B$2:$B$10=B2)*(SWITCH(Sheet1!$C$2:$C$10,"A",4,"B",3,"C",2,"D",1)))
Thank you .. I managed to work past that. Now bumping into the original data uses named ranges (in a table) which i was trying to apply to your formula. That breaks things.
 
Upvote 0
Thank you .. I managed to work past that. Now bumping into the original data uses named ranges (in a table) which i was trying to apply to your formula. That breaks things.
It's breaking on empty cells anywhere in the sumproduct arrays'- which the named ranges all have as they are for the entire column.

Can
 
Upvote 0
In that case you need to add a default to the Switch like
Excel Formula:
=SUMPRODUCT((CONTROL=A2)*(CATEGORY=B2)*(SWITCH(RATING,"A",4,"B",3,"C",2,"D",1,0)))
 
Upvote 0
Sorted. Thanks both for your awesome help .. I'd have been hacking away for weeks.
 
Upvote 0

Forum statistics

Threads
1,215,530
Messages
6,125,347
Members
449,220
Latest member
Edwin_SVRZ

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