Div/0

J

JonathanW

I want to create an if statement that says if the result of another cell is
#DIV/0! then return the result 'price not available' otherwise then return
the result of that cell
 
D

David Biddulph

That will give "not available" for all types of error, not just Div/0, Max.

If you want to trap for Div/0 specifically, try
=IF(AND(ISERROR(A2),ERROR.TYPE(A2)=2),"not available",A2)
 
D

Dave F

Don't you just need to test for the error type, not whether there is an
error? I.e., =IF(ERROR.TYPE(A2)=2,"not available,A2) ?

Dave
 
T

T. Valko

If you want to trap for Div/0 specifically, try
=IF(AND(ISERROR(A2),ERROR.TYPE(A2)=2),"not available",A2)

That will fail if there isn't a #DIV/0! error. If A2 = a number the result
is #N/A: ERROR.TYPE(#N/A)

Biff
 
Top