#DIV/0!

B

Brandt

Is there a way to specify in an IF statement to do something if the
conditional statement returns a div/0 error.

For example: =IF(A1/A2=#DIV/0!,"You Must Enter a Positive Value",A1/A2)

Thanks for any help
 
B

Brandt

Oops,

I just read the post on the "trailing space / format question" that was
pretty dumb of me not to think of the ISERROR function.
 
B

Brandt

Thanks Frank,

I guess I somewhat oversimplified my question. I was actually calculating
the std deviation of entries, and just wanted to clean up the DIV/0! error
reading when only 1 or no entries were made. The question did seem pretty
dumb when I saw your reply. Sorry - Just didn't want to be to longwinded.

Thanks again

Brandt
 
B

Bob Phillips

Brandt,

ISERROR is needed there because that is the way to find the errors. In your
case, you can simplify it because it can only be caused by a zero divisor.
So you can test

=IF(A2=0,"You Must Enter a Positive Value",A1/A2)


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top