+ Reply to Thread
Results 1 to 4 of 4

Complex AND OR IF

Hybrid View

  1. #1
    Registered User
    Join Date
    10-02-2009
    Location
    DELAWARE
    MS-Off Ver
    Excel 2003
    Posts
    8

    Complex AND OR IF

    Hey,
    This should be my last question, I'm still learning.

    I would like to compare 2 cells, Sheet1!B2 and Sheet1!B3
    (
    If sheet1!b2 is between the values of "D101" AND "D105", OR EQUAL TO "D201", OR EQUAL TO "D203", OR EQUAL TO "E110", OR EQUAL TO "E111", OR between the values of "H107" AND "H110" OR between the values of "H107" AND "H110" OR between the values of "H203" AND H205
    )
    AND
    (
    if sheet!b3 is EQUAL TO "E" )

    then output a 1, if not, output a zero

    The formula, which I deleted, excel reports back as being too long
    Last edited by NBVC; 10-05-2009 at 10:41 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex AND OR IF

    Try:

    =--AND(OR(Sheet1!B2={"D101","D102","D103","D104","D105","D201","D203","E110","E111","H107","H108","H109","H110","H203","H204","H205"}),Sheet1!B3="E")
    check that I have inserted all appropriate codes.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-02-2009
    Location
    DELAWARE
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Complex AND OR IF

    Yup, seems to work fine. I put D105 into it. What do the dashes at the beginning do?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Complex AND OR IF

    The dashes coerce results of TRUE to 1 and result of FALSE to 0...

    Then AND and OR functions return TRUE/FALSE boolean results... so don't need IF(), just coercement...

+ 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