Avatar of Bright01
Bright01
Flag for United States of America asked on

Embedding the appropriate nested "If" statement

EE Professionals,

I have a quick need for adding an embedded if statement (2nd level).  I have attached a graphic that shows what I'm trying to have the formula do.

Thank you in advance,

B.
Nested-If-Statement.png
Microsoft Excel

Avatar of undefined
Last Comment
Bright01

8/22/2022 - Mon
Saqib Husain

=if(05="One time",N5, <...>)

Replace <...> with your previous formula.
Bright01

ASKER
ssaquibh,

The formula works.  However, I have one complication.  I have a macro that automatically updates the formula when a change occurs.  I get a Compile error that seems to be caused by the word "ONE" in this formula.

Range("R" & Target.Row).FormulaR1C1 = _
                   "=if(RC[-3]="One Time",RC[-4],if(RC[-4]=0,0,RC[-4]*(1+RC[-1])^(VLOOKUP(RC[-3],CA_Calc_Engine!R7C6:R15C8,3,0))*RC[-2]))"

Any ideas on what I'm doing wrong as I try to incorporate the formula in my macro?

B.
ASKER CERTIFIED SOLUTION
Saqib Husain

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Bright01

ASKER
Thank you ssaqubh!  Complicated WS and formula; but your formula and assistance provided the correct answer.

B.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes