+ Reply to Thread
Results 1 to 5 of 5

Nesting If AND and OR all at once

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    41

    Nesting If AND and OR all at once

    Hi,

    In column M i have a series of dates. In columns N and O i have price data. I would like to be able to draw out into column P all the dates where (N1>0 AND O1<0) or (N1<0 AND O1>0), i.e. where one column contains a positive number and the other column contains a negative number.
    I can write it out in English but can't seem to get the AND and OR in the right place to make this work.

    IF(((N1>0 AND O1<0) OR (N1<0 AND O1>0)), M1,"")

    Please could someone help?

    Thanks
    Jo

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Nesting If AND and OR all at once

    If(OR(AND(N1>0, O1<0),N1<0, O1>0), M1,"")
    Last edited by K m; 08-10-2012 at 01:45 PM.
    Click on star (*) below if this helps

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Nesting If AND and OR all at once

    Jo,

    Quote Originally Posted by jswainson View Post
    IF(((N1>0 AND O1<0) OR (N1<0 AND O1>0)), M1,"")
    =IF(OR(AND(N1>0,O1<0),AND(N1<0,O1>0)),M1,"")
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Nesting If AND and OR all at once

    How about:

    Please Login or Register  to view this content.
    Docendo discimus.

  5. #5
    Registered User
    Join Date
    07-30-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Nesting If AND and OR all at once

    Thanks very much - that works.

    Jo

+ 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