简体   繁体   中英

Change formula based on cell value excel

I am trying to change the formula of cell B based on the value of cell A. If the value in A is 2, i want the formula to be e^(-b*x) and otherwise it should be x^2.

I tried it with an IF-statement:

=IF(G2=2; [D2*EXP(-(L2*E2))];[E2*E2])

But it does not work. Also, examples only use IF-statements to display text. So i am wondering if what i would like to do is even possible.

I think you don't need to use [] . On the docs when the value is between [] means optional.

Try this: =IF(G2=2;D2*EXP(-(L2*E2));E2*E2)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM