+ Reply to Thread
Results 1 to 10 of 10

Help with basic ISERROR with IF statement

  1. #1
    Registered User
    Join Date
    06-12-2014
    Posts
    4

    Help with basic ISERROR with IF statement

    I am trying to eliminate the annoying Div/0 error, however I dont know where to insert the ISERROR. Here is the formula I am using.


    =IF(D:D>E:E,D:D/E:E,E:E/D:D*-1)

  2. #2
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Help with basic ISERROR with IF statement

    Hi there,
    maybe:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Regards
    Miroslav R.

    (If You like my solutions, feel free to add reputation.)

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,852

    Re: Help with basic ISERROR with IF statement

    What result do you want if the denominator is zero? In this case, you do not have to use ISERROR, you can simply test for a zero denominator.

    =IF(D:D>E:E,IF(E:E=0,"?",D:D/E:E),IF(D:D=0,"?",E:E/D:D*-1))

    Replace the two "?" with whatever you want to show if the denominator is zero in each of the two cases.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,852

    Re: Help with basic ISERROR with IF statement

    By the way, it's a little unusual to use that syntax, although it works. Some, but not all, functions will return an array when you provide array arguments. Unfortunately this behavior is not well documented by Microsoft, so I tend to avoid it.

    The more usual version would be

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and copy down.

  5. #5
    Registered User
    Join Date
    06-12-2014
    Posts
    4

    Re: Help with basic ISERROR with IF statement

    Thank you, your solution worked. I appreciate the help.

  6. #6
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Help with basic ISERROR with IF statement

    You are welcome!

    send from my xperia z via tapatalk

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help with basic ISERROR with IF statement

    =IF(D:D>E:E,D:D/E:E,E:E/D:D*-1) strange formula what's it supposed to do
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    Registered User
    Join Date
    06-12-2014
    Posts
    4

    Re: Help with basic ISERROR with IF statement

    Thank you, this worked exactly how i wanted it to.
    =IF(D:D>E:E,IF(E:E=0,"N/A",D:D/E:E),IF(D:D=0,"0%",E:E/D:D*-1))

    Changed the "?" to what i needed them to display as you suggested.
    I appreciate the help!!

  9. #9
    Registered User
    Join Date
    06-12-2014
    Posts
    4

    Re: Help with basic ISERROR with IF statement

    I actually ended up changing it slightly. Which works essentially the same for what I need it to do.
    =IF(D:D>E:E,IF(E:E=0,"N/A",D:D/E:E),IF(D:D=0,"0%",E:E/D:D*-1))

    It's for a basic spreadsheet I needed to track donations vs receiving and show the ratio/percentage.
    D= donations
    E= received

    If the person donates more than they receive then they will have a positive ratio.
    If the person receives more than they donate then they will have a negative ratio.
    I was having an issue for when someone donates but does not receive (div/0 error), and for when someone does not donate but does receive.
    Now when someone donates but does not receive it shows "N/A"
    But when someone does not donate but does receive it shows "0%"

  10. #10
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,852

    Re: Help with basic ISERROR with IF statement

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking on the star icon below their name.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] where to put iserror/isna statement
    By cherryt in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-10-2013, 04:11 AM
  2. IF iserror , shortening the statement.
    By excel_me in forum Excel General
    Replies: 1
    Last Post: 07-29-2011, 10:11 AM
  3. Nested IF(ISERROR statement
    By JYonker in forum Excel General
    Replies: 2
    Last Post: 12-30-2010, 04:49 PM
  4. If statement with iserror
    By adam2308 in forum Excel General
    Replies: 3
    Last Post: 06-12-2009, 09:27 AM
  5. ISERROR at end of IF Statement
    By Dexta_Dark in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-21-2008, 05:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1