SUMPRODUCT of text values where each text value corresponds to a number in a lookup table

sdetwiler19

New Member
Joined
Jan 30, 2016
Messages
3
I'm trying to perform a SUMPRODUCT of 2 columns where each value is text, but those text values correspond to numbers in a lookup table. There's an easy way to do this using hidden columns that perform the VLOOKUP part, but I'm trying to avoid any hidden columns.

I know that the following formula doesn't work, but it best illustrates what I'm trying to do:

=SUMPRODUCT(VLOOKUP($C$10:$C$24,PRIORITY_SCORE,2,FALSE)*VLOOKUP($E$10:$E$24,RATING_SCORE,2,FALSE))

Here's an example of the data:

CE
CriticalExceeds
CriticalMeets
HighLimited
MediumNone

<tbody>
</tbody>

The PRIORITY_SCORE reference looks like this:

Low1
Medium2
High3
Critical4

<tbody>
</tbody>

The RATING_SCORE reference looks like this:

None0
Limited1
Meets2
Exceeds3

<tbody>
</tbody>

So the expected output would be as follows:

CEproduct
Critical = 4Exceeds = 312
Critical = 4Meets = 28
High = 3Limited = 13
Medium =2None =00

<tbody>
</tbody>

Formula output = 23

Any thoughts or suggestions would be much appreciated!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Does this work for you?

=SUMPRODUCT(SUMIF(INDEX(PRIORITY_SCORE,0,1),C10:C24,INDEX(PRIORITY_SCORE,0,2)),SUMIF(INDEX(RATING_SCORE,0,1),E10:E24,INDEX(RATING_SCORE,0,2)))
 
Upvote 0
Welcome to the MrExcel board!

No problem with the suggested formula, but just a couple of comments/ideas to consider.

1. Because the two columns of your named ranges are distinctly text:numbers you could shorten the formula a bit by not indexing to get the first part of each SUMIF. So I think this should do the same job:

=SUMPRODUCT(SUMIF(PRIORITY_SCORE,C10:C24,INDEX(PRIORITY_SCORE,0,2)),SUMIF(RATING_SCORE,E10:E24,INDEX(RATING_SCORE,0,2)))



2. If you have introduced the named ranges to help with this calculation, it may be worth expending a little more effort to name each column of those two existing ranges separately. Say
PS_1 (for Priority Score col 1 etc)
PS_2
RS_1
RS_2

By doing that, your formula simplifies (& shortens) again to

=SUMPRODUCT(SUMIF(PS_1,C10:C24,PS_2),SUMIF(RS_1,E10:E24,RS_2))
 
Upvote 0
Hi Peter_SSs,

Thanks for the simplification! That works perfectly as well. I separated the named ranges as you suggested. Here's where I ended up:

{=SUMPRODUCT(SUMIF(PRIORITY,$C$10:$C$31,PRIORITY_SCORE),SUMIF(RATING,D$10:D$31,RATING_SCORE))/SUM(SUMIF(PRIORITY,$C$10:$C$31,PRIORITY_SCORE))}

The second piece of this divides by the sum of the values corresponding to the priorities, in order to get a weighted average score. I haven't seen this behavior with SUMIF before where the result is an array, but looks like a useful function!

Thanks to both of you for your help!
 
Upvote 0

Forum statistics

Threads
1,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

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