1. Is there a function with in Excel that returns zero for a undefined computation such as in 100 / 0?

Thanks,
John

2. In Excel 2003 and before, you can use IF in combination with ISERROR, e.g.

=IF(ISERROR(A1/A2),0,A1/A2)

In Excel 2007 and later, you can use IFERROR, e.g.

=IFERROR(A1/A2,0)

3. Originally Posted by jstevens
Is there a function with in Excel that returns zero for a undefined computation such as in 100 / 0?
John
Or try this,

can be used in all Excel versions and without ISERROR testing function :

=IF(A2,A1/A2,0)

Regards
Bosco

4. Originally Posted by bosco_yip
Or try this,

can be used in all Excel versions and without ISERROR testing function :

=IF(A2,A1/A2,0)

Regards
Bosco
While your solution works with numbers entered in A1:A2; if text is entered in either cell an error is returned. The solution offered by Hans "=IF(ISERROR(A1/A2),0,A1/A2)" does not succumb to this trap.

5. Originally Posted by Don Wells
While your solution works with numbers entered in A1:A2; if text is entered in either cell an error is returned. The solution offered by Hans "=IF(ISERROR(A1/A2),0,A1/A2)" does not succumb to this trap.
But, the OP asked for : " How to return zero when computation in 100 / 0 ? ( or A1/A2 )"

I think the cell A1:A2 ( 100 / 0 ) were numbers

The ISERROR() definite not required

Regards
Bosco

#### Posting Permissions

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