Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Replace #DIV/0! With other values (https://www.askmehelpdesk.com/showthread.php?t=214280)

  • May 9, 2008, 01:21 PM
    Wonder84lalala
    Replace #DIV/0! With other values
    Is it possible to replace the output from #DIV/0! To 0 or other random values within a cell?

    I tried using if statement, but it won't let me:

    =IF(A1=#DIV/0! 0)

    Thanks for your help.
  • May 9, 2008, 02:42 PM
    JBeaucaire
    Say you want to divide the value in A1 by the value in A2. That formula is simple:
    Code:

    =a1/a2
    The problem is that if the value in A2 is zero, it doesn't work, thus the error you're seeing, so check that cell first. There are couple of ways to do that.
    Code:

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


  • All times are GMT -7. The time now is 08:17 PM.