+ Reply to Thread
Results 1 to 4 of 4

If and OR function gives incorrect results

  1. #1
    Forum Contributor
    Join Date
    06-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2019 Version1808
    Posts
    300

    If and OR function gives incorrect results

    Hi Experts,

    Trying to use IF OR functions together for meeting 4 given criteria as follows

    Criteria Last week sale This week sale Expected result of function
    1Cirteria $0 $0 "Left"
    2Cirteria $0 $1 100%
    3Cirteria $1 $0 "Left"
    4Cirteria $1 $2 (C5-B5)/B5

    I use Function in cell is E3 is:
    IF(OR(B2=0,C2=0,),"Left",IF(OR(B2>0,C2=0,),"Left",IF(OR(B2=0,C2>0,),100%,IF(OR(B2>0,C2>0,),(C2-B2)/B2%))))

    No matter what changes are made in cell C2, B2 , result is "LEFT"

    Thanks in advance

    Karnik

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: If and OR function gives incorrect results

    Perhaps:
    Please Login or Register  to view this content.
    I'm not sure whether the last test (in red) is necessary.
    Last edited by leelnich; 02-05-2018 at 03:16 AM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Forum Contributor
    Join Date
    06-24-2012
    Location
    Australia
    MS-Off Ver
    Excel 2019 Version1808
    Posts
    300

    Re: If and OR function gives incorrect results

    Hi Leelnich,

    Thanks! I slightly modified and it is giving me perfect results....Your function is brilliant example of simplicity , esp. when you compared to mine lengthy if/or
    You must be statistical/maths wizard!
    Thanks
    Karnik

  4. #4
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: If and OR function gives incorrect results

    Happy to help, thanks for the kind feedback! Just remember, there's usually no need to test complementary conditions. If you test for [A1>0], any values that fail are >= 0, so explicitly testing for [A1>=0] too is redundant. Regards - Lee

+ 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] Incorrect results from sort
    By pongmeister in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-12-2016, 11:20 AM
  2. [SOLVED] Some incorrect results from a formula
    By spittingfire in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-09-2015, 08:25 PM
  3. [SOLVED] Incorrect results of UDF function
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-29-2014, 06:28 PM
  4. Index/Array results incorrect
    By x65140 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2014, 01:50 PM
  5. [SOLVED] Forumula Results Incorrect when data missing. Wanting to hide the incorrect formula.
    By firemedic6265 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-05-2014, 05:01 PM
  6. Sum function returning incorrect results
    By Elena.P in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-16-2013, 01:26 PM
  7. Slightly incorrect formula results
    By ianpwilliams in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-06-2013, 05:04 PM

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