+ Reply to Thread
Results 1 to 4 of 4

IF and OR statement

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-23-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 365
    Posts
    166

    IF and OR statement

    I have multiple conditions for my statement and can't seem to get the right output.
    I have 2 cells just dividing each other. I want to retrieve #N/A or Error.Type(7) if the calculation retrieves a zero or error.
    =IF(OR(ISERROR(AG82/AH82),(AG82/AH82)=0),ERROR.TYPE(7),AG82/AH82)
    I keep still get the #DIV/0 error when the two cells are 0/0.

    The output I want is error.type(7)

    Plz Help!

    Thanks

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: IF and OR statement

    Formula: copy to clipboard
      =if(AG82 =0, "error.type(7)",if(AH82=0,"#N/A",AG82/AH82) )
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: IF and OR statement

    Try this instead.
    Formula: copy to clipboard
    =LOOKUP(1E+306,--CHOOSE({1,2,3,4},ISERROR(AG82/AH82),(AG82/AH82)=0,ERROR.TYPE(AG82/AH82),AG82/AH82))
    If your are not aware of it the number(s) in ERROR.TYPE are what the function returns when wrapped around an equation.

    If what you expect is 7 then enter it as a constant like this.
    Formula: copy to clipboard
    =LOOKUP(1E+306,--CHOOSE({1,2,3,4},ISERROR(AG82/AH82),(AG82/AH82)=0,7,AG82/AH82))
    Dave

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: IF and OR statement

    Or:

    =IF(OR(N(AG82)=0,N(AH82)=0),"ERROR.TYPE(7)",AG82/AH82)

+ 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] i have an if then statement that works, how to make it work as a with or case statement
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2016, 03:34 PM
  2. Replies: 2
    Last Post: 07-09-2015, 04:25 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 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