1. I have the following formula =IF(C151<0,(-B151+C151)/C151,B151/C151-1)

However, If the value in C151 or B151 is zero, the formula returns #DIV/0

I want to use the ISERROR formula that if this is the case, it mut return a zero as the result

Your assistance will be most apreciated

2. =IF(OR(C151=0,B151=0),0,IF(C151<0,(-B151+C151)/C151,B151/C151-1)) should do it.

3. Originally Posted by Andrew W
=IF(OR(C151=0,B151=0),0,IF(C151<0,(-B151+C151)/C151,B151/C151-1)) should do it.
and if you want the cell to be blank instead of 0.

=IF(OR(C151=0,B151=0),"",IF(C151<0,(-B151+C151)/C151,B151/C151-1))

4. Howard,

To use ISERROR

IF(ISERROR(C151<0),0,if(c151<0,(-B151+C151)/C151,B151/C151-1))

5. I am not sure why you would want to use ISERROR here since it appears the only source of #DIV/0 is when C151=0 Or Blank
I guess really you ought to also test for C151="" As Well

=IF(OR(C151=0,C151="",B151=0),0,IF(C151<0,(-B151+C151)/C151,B151/C151-1))

If you use ISERROR on C151 you do not allow for B151 = 0

In this case =IF(ISERROR(C151<0),0,IF(C151<0,(-B151+C151)/C151,B151/C151-1)) still generates #DIV/0 if C151 is 0 OR Blank

=IF(ISERROR(1/C151),0,IF(C151<0,(-B151+C151)/C151,B151/C151-1)) will generate 0 when C151 is 0

but it will still not generate 0 when C151 is not 0 and B151 is 0

Indeed if B151 =0 and C151 = 2 this generates -1 not 0 and I think the original question said

IF B151 =0 OR C151 =0 it should be 0

6. Hi Guys

Thanks for the help. I have used the formula =IF(OR(C151=0,C151="",B151=0),0,IF(C151<0,(-B151+C151)/C151,B151/C151-1)) instead if ISERROR

7. Since you are using 2007, you can use IFERROR:
=IFERROR(IF(C151<0,(-B151+C151)/C151,B151/C151-1),0)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•