Consulting

Results 1 to 6 of 6

Thread: using (iserror) in if statement

  1. #1
    VBAX Regular sburgess's Avatar
    Joined
    Sep 2008
    Location
    Dearborn Heights, MI
    Posts
    18
    Location

    Question using (iserror) in if statement

    I'm trying to supress a #div (divide by zero) error, and I'm using if(iserror(formula), and anything that has a an error, is working good. It brings back a 0 for me. What the problem is, anything that is false (not giving a divide by zero error), is returning a false statement. I need it to calculate the formula that I have in the statement, and return the value, not "false".

    Any help on this, as this is the first time I have used the (iserror) in a formula?

    Here is the if statement that I'm using...

    =IF(ISERROR(IF('MSO PR'!Z14=0,0,(IF('MSO PR'!AB14<>0,'MSO PR'!AB14-'MSO PR'!Z14,0)))/'MSO PR'!Z14),0)

    A suggestion was to include another if statement at the beginning, using the Iserror as the "true" statement, and the rest of the formula as the "false",

    so it would be something like this -

    =if('mso pr'!ab14=0,(IF(ISERROR(IF('MSO PR'!Z14=0,0,(IF('MSO PR'!AB14<>0,'MSO PR'!AB14-'MSO PR'!Z14,0)))/'MSO PR'!Z14),0)))

    I know that I'm probably way off, but this is what I need it to do. Any help would be great!

    - Sandy -

  2. #2
    VBAX Regular MikeBlackman's Avatar
    Joined
    Apr 2009
    Location
    Basingstoke, UK
    Posts
    19
    Location
    Hi,

    Please leave links for cross forum posts to avoid people spending time on your problem when you may already have a solution;

    http://www.mrexcel.com/forum/showthr...=1#post1910815
    Kind regards

    Mikey B

    Assiduus Adduco de Silentium

  3. #3
    VBAX Regular sburgess's Avatar
    Joined
    Sep 2008
    Location
    Dearborn Heights, MI
    Posts
    18
    Location
    Thanks! Honestly didn't know that the 2 were together, that's why I posted on both. I don't get here that often.

    got problem resolved! Thanks!
    - Sandy -

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    They are not together, it is just good manners not to waste people's time working on a problem that other people are working on elsewhere.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular sburgess's Avatar
    Joined
    Sep 2008
    Location
    Dearborn Heights, MI
    Posts
    18
    Location
    I wasn't trying to waste anyone's time. I was just trying to get some help, for something that I was having a problem with.
    - Sandy -

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You are wasting our time if we spend time and effort working on a solution for you and then we find that it was already solved half an hour earlier at MrExcel.

    If you post a link, we at least then know, and we can ignore your request (which is what I do), or we can check out the other site before trying to help.

    Just good manners when looking for free support, as explained here
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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