Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel formula with dynamic inputs & dynamic outputs

I have two table ranges in excel. One will have the conditions and equivalent formulas to be used for those conditions. And in other table, I have conditions and their input values that should be given to the formulas. I need to substitute the inputs with the relevant condition formula and get the output. How to do it directly in MS excel without using VBA

enter image description here

enter image description here

enter image description here

I've tried using What if analysis and Lambda formulas. But in anymeans I couldn't get that.

like image 429
Saravanan Manamohan Avatar asked Dec 21 '25 06:12

Saravanan Manamohan


1 Answers

There are many options, here I choose to include an old Excel v4.0 macro function called EVALUATE(). I made a custom function through name manager called EVAL() which refers to:

=LAMBDA(x,EVALUATE(x))

Then I simply went over your data using MAP(), gave all values a variable and used SUBSTITUTE() to make a mathematical sound string to be evaluated:

enter image description here

Formula in G2:

=MAP(D2:D7,E2:E7,F2:F7,LAMBDA(x,y,z,EVAL(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(VLOOKUP(x,A2:B4,2,0),E$1,"*"&y),F$1,"*"&z),"+*","+"))))
like image 152
JvdV Avatar answered Dec 23 '25 19:12

JvdV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!