+ Reply to Thread
Results 1 to 6 of 6

Thread: If and or

  1. #1
    Registered User
    Join Date
    07-17-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    28

    If and or

    Hi,
    I have the formula below.
    I want to add an "or" statement to the formula so that Q380 can = 0 or ISNA for the statement to be true (along with the other statements below).

    Current Statement
    =IF(AND(ISNA(Q380),S380=0,T380=0,R380=0),E380,"")

    How can I do that?

    Thanks,

    Jason

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    MS 2007
    Posts
    5,372

    Re: If and or

    Sounds like what you want is

    =IF(AND(OR(ISNA(Q380),Q380=0),S380=0,T380=0,R380=0),E380,"")
    ChemistB
    My 2˘

    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

  3. #3
    Forum Guru contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2010
    Posts
    1,342

    Re: If and or

    Maybe

    =IF(AND(OR(ISNA(Q380),Q380=0),S380=0,T380=0,R380=0),E380,"")

    EDIT: Simultaneous posting with ChemistB, who
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, «Born in USSR»
    Vusal M Dadashev

    Baku, Azerbaijan

  4. #4
    Registered User
    Join Date
    07-17-2009
    Location
    Paris
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: If and or

    OK - sees logical but surprisingly I am getting an answer of #N/A when there is #N/A in the Q380 cell.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    MS 2007
    Posts
    5,372

    Re: If and or

    You're right. Didn't think it through. Excel tries to determine if Q380 = 0 and that screws up the formula. You'll need nested IFs like so

    =IF(AND(S380=0,T380=0,R380=0,E380SNA(Q380)),E380,IF(AND(Q380=0,S380=0,T380=0,R380=0),E380,""))

    Does that work for you?
    Last edited by ChemistB; 08-12-2010 at 12:41 PM.
    ChemistB
    My 2˘

    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

  6. #6
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: If and or

    One alternative might be:

    =IF(AND(ISNA(MATCH(SIGN(Q380),{-1,1},0)),COUNTIF(R380:T380,0)=3),E380,"")

+ 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.2.0