# Thread: Stopping a calculation (XP Edition)

1. ## Stopping a calculation (XP Edition)

Hi,

I have cells in a worksheet which calculate the average cost of nursing of visits being made. I'm using a simple formula to find the average.
The formula works fine except in instances where the cell used to divide is =0. The error #DIV/0! is returned as I would expect. I would like to be able to code this so that if the value in the cell being used to divide is = 0 then the cell containing the formula would return a value of 0.

Thanks,
Leesha

2. ## Re: Stopping a calculation (XP Edition)

Say that you have a formula =A1/B1. This will result in #DIV/0! if B1 is zero. You can replace the formula by =IF(B1=0,0,A1/B1) to return 0 if B1 is zero, or =IF(B1=0,"",A1/B1) to return an empty value if B1 is zero.

3. ## Re: Stopping a calculation (XP Edition)

Hi Hans!!

Boy you help out all over! That did exactly what I wanted it to. I've never put IF/Than statements directly into the cells as formulas.

Thanks so much for the help.

Leesha

#### Posting Permissions

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