+ Reply to Thread
Results 1 to 6 of 6

Combining IF functions

  1. #1
    Registered User
    Join Date
    11-09-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Combining IF functions

    Hi

    Really hoping someone can help me here!

    I currently have 2 IF functions in different columns to return the same result. I really need to combine the two IF functions into the same column, but cant resolve the conflicts:


    =IF(U22<R22,"N/A",IF(W22>P22,"PASS","FAIL"))

    =IF(AND(T21="FAIL", Z21="TAPE TRAFFIC"), "FAIL"," ")

    Essentially, I would like the search to return a result of:
    - PASS or
    - FAIL or
    - TAPE TRAFFIC or
    - N/A If none of the above

    This may not even be possible, but all thoughts are welcome!


    Many thanks

    Neil

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Combining IF functions

    Hi,

    I think you need to tell us which of the two should take precedence. (Assuming I understand your problem)

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Combining IF functions

    What logic results in "TAPE TRAFFIC" appearing? You didn't represent that in your examples.

    Also, the ORDER that these tests are conducted is critical to get right. IF U22<R22, the the result will be "N/A" and nothing else will evaluate. Please list the logic steps in order you want them tested.

    U22<R22 = "N/A"
    W22>P22 = "PASS"
    T21="FAIL" and Z21="TAPE TRAFFIC" = "FAIL"
    ???? = "TAPE TRAFFIC"
    ???? = " "
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    11-09-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Combining IF functions

    Hi guys

    Many thanks for the comments

    Unfortuantely, I posted the wrong criteria on my original post. The two calculations i am trying to combine are into one search:


    =IF(S22<R22,"N/A",IF(V22>P22,"PASS","FAIL"))
    =IF(AND(T21="FAIL", Y21=" TAPE TRAFFIC"), "FAIL"," ")


    TAPE TRAFFIC calculation is determined by:

    =IF(AND(T21="FAIL",S21<R21),"TAPE TRAFFIC","")


    So the order would need to be:
    1.)PASS (if V22>P22)
    2.)FAIL (if V22<P22 or IF(AND(T21="FAIL",S21<R21),"TAPE TRAFFIC")
    3.)N/A (if S22<R22)


    I have managed to confuse myself on this, but im sure this is what i need

    All comments welcome



    Many thanks

    Neil

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Combining IF functions

    You listed TAPE TRAFFIC as a separate possible result, but you failed to list it in the order of criteria....you merged it into the second one which leads to more confusion.

    If there are 4 possible answers, you should have 4 lines of order, yes? Or for this need, is there really only 3 needed?

    If only 3, then try:
    =IF(V22>P22, "PASS", IF(OR(V22<P22, AND(T21="FAIL", S21<R21)), "FAIL", IF(S22<R22, "N/A", "")))
    Last edited by JBeaucaire; 11-09-2009 at 09:23 PM.

  6. #6
    Registered User
    Join Date
    11-09-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Combining IF functions

    Thank you JBeaucaire!!

    That worked. Much appreciated mate


    Neil

+ 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