Can u put an "IF" inside of another "IF"??

  • Thread starter Thread starter NotExcelingNow
  • Start date Start date
N

NotExcelingNow

Or how else could you do something like that? I need a excel program to do
something similar to this:

=ROUND(IF(O60=TRUE,AVERAGE(P42:Q43),(IF(P58=P59,AVERAGE(P58:P59),P60),0
 
yes, you can do that, almost exactly. you just need some more
paretheses, i think............

=ROUND(IF(O60=TRUE,(AVERAGE(P42:Q43)),(IF(P58=P59,
(AVERAGE(P58:P59)),P60))))

i don't have it quite right, yet, it says there's an error. i'm
horrible with nesting formulas & having the correct number of
parentheses & arguments! a tip, tho - when you're constructing the
formula up in the formula bar as you move the cursor from parenthesis
to parenthesis, they are different colors and light up so you can make
sure you've got an opening one & a closing one.
hope it got you started, at least!
:)
susan
 
I think you were just missing a close parentheses after that P60. Try this:
=ROUND(IF(O60=TRUE,AVERAGE(P42:Q43),(IF(P58=P59,AVERAGE(P58:P59),P60))),2)

It rounds to two decimal places; change the 2 right at the end to get more
or less precision.

Regards,
Ryan--
 
Sometimes, too many ()'s make formulas easier to read--sometimes, they hurt.

=ROUND(IF(O60=TRUE,AVERAGE(P42:Q43),IF(P58=P59,AVERAGE(P58:P59),P60)),0)
or just
=ROUND(IF(O60=TRUE,AVERAGE(P42:Q43),IF(P58=P59,P58,P60)),0)

if p58=p59, then average(p58:p59) will be the same as either number:

average(3,3) = 3
average(3134,3134)=3134
 
THANK YOU!!!!

Just wanted to post the final formula.

=ROUND(IF(O63=TRUE,AVERAGE(P45:Q46),IF(D61=TRUE,AVERAGE(P44:Q46),IF(E61=TRUE,AVERAGE(P43:Q46),IF(F61=TRUE,AVERAGE(P42:Q46),IF(G61=TRUE,AVERAGE(P41:Q46),IF(H61=TRUE,AVERAGE(P40:Q46),P46)))))),0)

=AND(M63=TRUE,H46=H45,H45=H44,H44=H43,H43=H42,H41=H42,H41=H40)

=IF(O63=TRUE,"The average ",IF(D61=TRUE,"The average ",IF(E61=TRUE,"The
average ",IF(F61=TRUE,"The average ",IF(G61=TRUE,"The average
",IF(H61=TRUE,"The average ","The "))))))

I got everything running just like I wanted, thank you sooo much!
 
Back
Top