+ Reply to Thread
Results 1 to 5 of 5

2 conditions in IF/AND formula

Hybrid View

  1. #1
    Registered User
    Join Date
    03-18-2008
    Posts
    3

    2 conditions in IF/AND formula

    Hi all,

    I need help with my formula. I have two different columns which are needed to give me my answer in the 3rd column.

    Column 1 is $ AMOUNT
    Column 2 is a Yes/No Choice

    So, between these 2 fields, I want 5 different options:
    1. <$100 and YES - return a "1"
    2. <$100 and NO - return a "-1"
    3. >=$100 and YES - return a "1"
    4. >=$100 and NO - return a "-1"
    5. Blank cell for $ and either YES/NO - return a "0"

    Here is my formula so far:
    =IF((AND(A2<100,B2="YES")),1,IF((AND(A2>=100,B2="YES")),1,-1))

    I'm close but I can't complete my formula. All that is missing is Option 5: if I don't have a $ amount, put a "0" regardless of the second (Yes/No) condition.

    Thanks in advance!

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

    =IF(A2="",0,IF(OR(AND(A2<100,B2="YES"),AND(A2>=100,B2="YES")),1,-1))
    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
    03-18-2008
    Posts
    3
    it worked..thanks so much

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    After looking at this again, it seems that really you want a 1 if B2="Yes" and and a -1 if B2 is otherwise....It doesn't really seem to matter what the number in A2 is, as long as it is not blank.

    so wouldn't this just do it?

    =IF(A2="",0,IF(B2="YES",1,-1))

  5. #5
    Registered User
    Join Date
    03-18-2008
    Posts
    3
    that works as well and it's cleaner.
    I'll use this.

    Thanks again

+ 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