+ Reply to Thread
Results 1 to 5 of 5

Multiple If Statement Help

Hybrid View

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

    Re: Multiple If Statement Help

    A bit confusing, but do you mean?

    =IF(OR(J2={"Maintain","Not Found"}),J2,IF(J2="Return",IF(L2="Agree","Save","Conflict"),IF(OR(J2={"Discard","Transfer"}),IF(I2<>"GC",IF(COUNTIF(K2:L2,"Agree")=2,"Discard","Conflict"),
    IF(COUNTIF(K2:N2,"Agree")=4,"Discard","Conflict")))))
    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.

  2. #2
    Registered User
    Join Date
    06-18-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Multiple If Statement Help

    Forgive me, let me explain the logic a bit more and the addition I want to the code

    The main input is J2 with secondary inputs K2:N2 and the output is O2

    =IF(OR(J2={"Maintain","Not Found"}),J2,IF(J2="Return",IF(L2="Agree","Save","Conflict"),
    The only thing wrong with the above code is that IF J2=Not found, it is not outputting not found

    Below is what I wanted to replicate to work with IF J2=Transfer
    IF(J2="Discard",IF(I2<>"GC",IF(COUNTIF(K2:L2,"Agree")=2,"Discard","Conflict"),
    IF(COUNTIF(K2:N2,"Agree")=4,"Discard","Conflict")))))
    What this code says is just if I2 is not equal to GC, then follow this if statement:
    If J2=discard, then if both K2:N2 say Agree, output Discard. If one of K2 or N2 say disagree then output conflict

    If I2=GC, then follow this if statement:
    If J2=discard, then all four of K2:N2: say agree, output Discard. If one of K2 through N2 say disagree then output conflict.

    I wanted to just add on this block of code to the main formula(so it works with IFJ2=Transfer)
    IF(J2="Transfer",IF(I2<>"GC",IF(COUNTIF(K2:L2,"Agree")=2,"Transfer","Conflict"),
    IF(COUNTIF(K2:N2,"Agree")=4,"Transfer","Conflict")))))

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

    Re: Multiple If Statement Help

    Try:

    =IF(OR(J2={"Maintain","Not Found"}),J2,IF(J2="Return",IF(L2="Agree","Save","Conflict"),IF(J2="Discard",IF(I2<>"GC",IF(COUNTIF(K2:L2,"Agree")=2,"Discard","Conflict"),IF(COUNTIF(K2:N2,"Agree")=4,"Discard","Conflict")),IF(J2="Transfer",IF(I2<>"GC",IF(COUNTIF(K2:L2,"Agree")=2,"Transfer","Conflict"),
    IF(COUNTIF(K2:N2,"Agree")=4,"Transfer","Conflict"))))))
    I fixed your first issue too.. I think the Data Validation list had an extra space after the "Not Found" entry.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-18-2010
    Location
    Dallas
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Multiple If Statement Help

    That worked wonders.
    Also, thank you for fixing the other "not found" problem, I could not figure it out.

    Thanks for your patience with me.
    Your help is greatly appreciated.

    Sincerely,

    -vargs

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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