+ Reply to Thread
Results 1 to 3 of 3

IF OR ISERROR problem

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    IF OR ISERROR problem

    Okay, my formula doesn't work, and I'm at a loss. Here's what I want to do:

    IF O2 minus J2 is an error (because there's no values in O2 or J2), OR if O2 minus J2 is Zero or less, don't show anything. Otherwise, show the results of O2-J2. Code is below, but I've got something hosed and can't figure out what. Any help would be appreciated.


    =IF((OR(ISERROR(O2-J2),O2-J2<=0)),"",O2-J2)
    Last edited by jomili; 01-03-2011 at 04:59 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: IF OR ISERROR problem

    Given the explicit coercion taking place as a result of the subtraction you need to test the Error first / separately:

    =IF(ISERROR(O2-J2),"",IF(O2<=J2,"",O2-J2))
    we don't know how O2:J2 are being populated but you might find you could get away with:

    =IF(OR(COUNT(O2:J2)<2,O2<=J2),"",O2-J2)
    but the former is more "robust"
    Last edited by DonkeyOte; 01-03-2011 at 05:01 PM. Reason: missing all important word !

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    4,056

    Re: IF OR ISERROR problem

    Thanks DonkeyOte;

    I hadn't even thought about splitting it up like that. I appreciate the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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