View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default #DIV/0! and IF statement

James,

=IF(B1=0," ",(A1-B1)/B1)

"James Hamilton" wrote:

I have 3 columns of data; A, B and C.

The formula for column C is = (A-B)/B

If column A is 0, then the result is -100%

If both column A and column B is 0 the result is #DIV/0!

What formula do I use so that when the answer is -100%, it says this, but
when the answer is #DIV/0!, I get a blank?

I'm trying is =if(iserror((a-b)/b),"",(a-b/b)) but I get blanks even if the
answer is -100%.

Thanks!