How to change the Formula, based on a Value in a List

WayneGoodrich

New Member
Joined
Jun 4, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have an excel spreadsheet with a Validated List with 4 different Values.
I want to change the Formula used in Row M based on the Value chosen in Row D
These are the list Values and formulas I want to choose, after selecting List Value
List ValueFormula
Continuous Unlined"=(K10*14)+8"
Drops Unlined"=((K10*14)+8)+(L10*6)"
Continuous Lined"=(K10*20)+9"
Drops Lined"=((K10*20)+9)+(L10*12)"

Any help would be appreciated,
Regards
Wayne
 

Attachments

  • Excel change formula based on List.PNG
    Excel change formula based on List.PNG
    87.3 KB · Views: 10

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
In M10 and copy down:
Excel Formula:
=IF(D10="Continuous Unlined",(K10*14)+8,IF(D10="Drops Unlined",(K10*14+8)+L10*6,IF(D10="Continuous Lined",K10*20+9,IF(D10="Drops Lined",(K10*20+9)+L10*12,"Not on the list"))))
 
Upvote 0
Solution
In M10 and copy down:
Excel Formula:
=IF(D10="Continuous Unlined",(K10*14)+8,IF(D10="Drops Unlined",(K10*14+8)+L10*6,IF(D10="Continuous Lined",K10*20+9,IF(D10="Drops Lined",(K10*20+9)+L10*12,"Not on the list"))))
Hi JoeMo,
I am probably doing something wrong, but when I copy your formula in, I always get the answer "Not on the List"
In M10 and copy down:
Excel Formula:
=IF(D10="Continuous Unlined",(K10*14)+8,IF(D10="Drops Unlined",(K10*14+8)+L10*6,IF(D10="Continuous Lined",K10*20+9,IF(D10="Drops Lined",(K10*20+9)+L10*12,"Not on the list"))))
Got it Right, Thanks for your help- Perfect solution, Thanks
 

Attachments

  • Excel change.PNG
    Excel change.PNG
    134.8 KB · Views: 2
Upvote 0
Welcome to the MrExcel board!

Other structures that you could use would be ..

Excel Formula:
=CHOOSE(MATCH(D10,{"Continuous Unlined","Drops Unlined","Continuous Lined","Drops Lined"},0),K10*14+8,K10*14+8+L10*6,K10*20+9,K10*20+9+L10*12)

.. or even

Excel Formula:
=LET(L,RIGHT(D10,6)=" Lined",D,LEFT(D10,1)="D",K10*(14+6*L)+8+L+L10*6*(1+L)*D)

Examples with all formulas

22 06 05.xlsm
DKLMNO
9JoeMoPeter_SSs1Peter_SSs2
10Continuous Unlined80120120120
11Drops Unlined85150150150
12Continuous Lined80169169169
13Drops Lined85229229229
14Continuous Unlined74106106106
15Drops Unlined183278278278
16Continuous Lined526109109109
17Drops Lined149397397397
CHOOSE or LET
Cell Formulas
RangeFormula
M10:M17M10=IF(D10="Continuous Unlined",(K10*14)+8,IF(D10="Drops Unlined",(K10*14+8)+L10*6,IF(D10="Continuous Lined",K10*20+9,IF(D10="Drops Lined",(K10*20+9)+L10*12,"Not on the list"))))
N10:N17N10=CHOOSE(MATCH(D10,{"Continuous Unlined","Drops Unlined","Continuous Lined","Drops Lined"},0),K10*14+8,K10*14+8+L10*6,K10*20+9,K10*20+9+L10*12)
O10:O17O10=LET(L,RIGHT(D10,6)=" Lined",D,LEFT(D10,1)="D",K10*(14+6*L)+8+L+L10*6*(1+L)*D)
 
Last edited:
Upvote 0
Hi JoeMo,
I am probably doing something wrong, but when I copy your formula in, I always get the answer "Not on the List"

Got it Right, Thanks for your help- Perfect solution, Thanks
You are welcome - thanks for the reply.
 
Upvote 0

Forum statistics

Threads
1,214,884
Messages
6,122,082
Members
449,064
Latest member
MattDRT

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