PDA

View Full Version : using (iserror) in if statement



sburgess
04-20-2009, 07:51 AM
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!

:banghead: :motz2:

MikeBlackman
04-20-2009, 08:09 AM
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/showthread.php?p=1910815&posted=1#post1910815

sburgess
04-20-2009, 08:29 AM
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!

Bob Phillips
04-20-2009, 09:19 AM
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.

sburgess
04-20-2009, 09:22 AM
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.

Bob Phillips
04-20-2009, 09:32 AM
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 (http://www.excelguru.ca/node/7)