If or statements containing multiple calculation depending on cell values

wh0

New Member
Joined
Mar 1, 2022
Messages
1
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Hi,
I have a workbook with multiple worksheets and table. I am trying to perform calculation depending on selected values in cell Column A. so in B1 I want the following to happen
if A1=ID 1 then do the following calculation C1*exp(-0.5/4)*(22-C1), or if A1=ID 2 then do this calculation D1*exp(-0.5/4)*(22-D1), or if A1= ID 3 then do this D1*exp(-0.5/4)*(22-D1), otherwise leave B1 blank.
ABCDE
1ID 1
2ID 2
3ID 3
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi & welcome to MrExcel.
Should ID 3 look at col E rather than D?
 
Upvote 0
Assuming the answer to my question is Yes, try
+Fluff 1.xlsm
ABCDE
1
2ID 1105.899610
3ID 275.012245
4ID 335.2998820
5ID 4 
Data
Cell Formulas
RangeFormula
B2:B5B2=LET(c,SWITCH(A2,"ID 1",C2,"ID 2",D2,"ID 3",E2,""),IFERROR(c*(22-c)*EXP(-0.5/4),""))
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,852
Members
449,194
Latest member
HellScout

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