Thread: IF statement
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default IF statement

You could just check the denominator.

=if(denom=0,"",numer/denom)

or if you're using xl2007, you can use =iferror().

Arun wrote:

Is there a way to simply IF statements that, for example, want to change the
result if a zero comes up. I have a formula with a long denominator. I
don't want the DIV0 error so I just want to say "IF the (denominator formula)
is 0, then make it 1. However, I don't want to type that whole formula that
is full of lookups and offsets in twice to accomplish this (once to ask if
it's zero, then again to set the value if it is not zero). If not, I think
I'm just going to write it myself.

CONDITIONALIF ([formula] , [value to check against] , [value if condition is
met])


--

Dave Peterson