Sum values based on their 'code'

SanctiMortem

New Member
Joined
Sep 29, 2016
Messages
6
Hi all,

I'm trying to find a way of adding a total value based on the selection of two different cells. These two cells have a drop down list, each of the options on that drop down list has a value:

Screen Shot 2022-03-13 at 17.50.11.pngScreen Shot 2022-03-13 at 17.50.46.png

The first image shows the drop list on the cells, and the second is a different sheet with the values.

Once you select your option from that drop down list, I need another cell to SUM the values corresponding to the selection.

For example, if I select Annual on the Insurance and Yes on the Rain Insurance, then I need the next cell to Add 130 plus 10 and give me the total of 140.
If the next row has Daily and Yes on the Rain Insurance then I need the next cell to add 25 plus 10 and give me 35.

How can I do this, I know its possible, but I'm trying not ti have a crazy formula of sumif and if or else and such if possible, I feel like those formulas on the larger scale can affect the performance of the file.

But then again, any solutions are welcome!
Thank you in advance.

Best Regards!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Let B2 house a Rain insurance selection ( B1 houses "Rain Insurance") ;

Name the area housing the two rows with Annual and FF ValuesTable ;

Name the area housing the two rows with Yes and No YesNoTable ;

In B3 enter either Yes or No ;

In B4 enter ;

=IF(B2="",0,VLOOKUP(B2,ValuesTable,2,0)+VLOOKUP(B3,YesNoTable,2,0)
 
Upvote 0
Solution
It sounds like VLOOKUP would be good here, wrapped in SUM. So in your sum cell: =SUM(VLOOKUP(Drop-down Cell, Range of possible options & their values, 2, FALSE), VLOOKUP(Rain Drop-down Cell, Range of possible options & their values, 2, FALSE))
 
Upvote 0
Hi,

Would this work for you also:

Book3.xlsx
ABCDEFGH
1Annual130Yes10
2DailyYes35Daily25No0
3LCN0
4FF0
Sheet1046
Cell Formulas
RangeFormula
C2C2=SUMIF(E$1:E$4,A2,F$1:F$4)+SUMIF(G$1:G$2,B2,H$1:H$2)
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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