John
John

Reputation: 456

How to add another IF statement in Excel and If A1=2 Then round output otherwise dont round?

I Have a formula that am trying to embed another If statement in.

=IF(ISBLANK(A10),"0",ROUND(A17+B1+B10+((A17+B10)*B1)+((I1+B10)*B10),0))

I need to embed another If that if A2=1 Then Round else don't round.

Thanks!

Upvotes: 1

Views: 181

Answers (2)

barry houdini
barry houdini

Reputation: 46341

Excel only recognises 15 significant places so rounding to 15 decimal places is really equivalent to not rounding at all, hence you can simply use your existing formula with a simple IF on the 2nd argument of round, i.e.

=IF(ISBLANK(A10),"0",ROUND(A17+B1+B10+((A17+B10)*B1)+((I1+B10)*B10),IF(A2=1,0,15)))

Upvotes: 1

Scott Holtzman
Scott Holtzman

Reputation: 27249

Easiest way is like this, albeit it's kind of ugly.

=IF(ISBLANK(A10),0,IF(A2=1,ROUND(A17+B1+B10+((A17+B10)*B1)+((I1+B10)*B10),0),A17+B1+B10+((A17+B10)*B1)+((I1+B10)*B10))

Upvotes: 1

Related Questions