• Function Assistance

    Author
    Topic
    #464727

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

    Thanks,
    John

    Viewing 1 reply thread
    Author
    Replies
    • #1190850

      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)

    • #1190970

      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

      • #1191135

        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.

        • #1191184

          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

    Viewing 1 reply thread
    Reply To: Function Assistance

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: