+ Reply to Thread
Results 1 to 5 of 5

Using IF for three scenarios

  1. #1
    Registered User
    Join Date
    08-01-2018
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    2

    Using IF for three scenarios

    I want column J to look at two data sources (column F and column H) and determine if they agree. If they do I want it to say "Match" and if they don't, say "No."

    In those columns the following items agree:
    column F="Passed", column H= "Yes"
    column F="Failed", column H="No"
    column F="Missing", column H=#N/A.

    Anything else and they do not agree.


    I used this formula: =IF((AND(F3="Passed",H3="yes")),"Match","No"). But it only looks at one item.

    I tried =IFERROR(IFS(AND(F3="Passed",H3="yes"),"Match",AND(F3="Failed",H3="No"),"Match",AND(F3="Missing",H3="#N/A"),"Match"),"No") but it just says "No" on all cells.

    Someone gave me this one to try =arrayformula(if(len(J3:J),if(iferror((J3:J="Passed")*(L3:L="Yes"))+iferror((J3:J="Failed")*(L3:L="No"))+((J3:J="Missing")*(iferror(L3:L="#N/A")+(isna(L3:L)))),"Match","No"),)) but it has too few arguments.


    Here is a screen shot:
    capture.PNG



    Can anyone help please?

  2. #2
    Registered User
    Join Date
    06-28-2018
    Location
    USA
    MS-Off Ver
    2010
    Posts
    19

    Re: Using IF for three scenarios

    So I tried this to solve this quickly before I had to leave for two hours but ran into an unexpected problem with #N/A. This works "passed" and "yes" as well as "failed" and "no." You can use this as a starting point.

    =IF(AND(A1="Passed",B1="Yes"),"Match",IF(AND(A1="Failed",B1="No"),"Match",IF(AND(A1="Missing",B1="#N/A"),"Match","No")))

    Excel recognizes #N/A as a special character I believe so you will have to play with it and probably use ISNA in the last part. If you can't get it and no one smarter than I posts a different solution then I will post a solution when I get home in two hours.

    LearningByError.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,377

    Re: Using IF for three scenarios

    Just change this:

    B1="#N/A"

    to this:

    ISNA(B1)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    08-01-2018
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    2

    Re: Using IF for three scenarios

    Thank you. Taking out the #N/A worked. Thanks!

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,377

    Re: Using IF for three scenarios

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Possible Scenarios
    By twafsu9 in forum Excel General
    Replies: 1
    Last Post: 12-28-2015, 10:46 PM
  2. Scenarios
    By annieshaw in forum Excel General
    Replies: 2
    Last Post: 10-18-2011, 08:59 PM
  3. [SOLVED] Scenarios
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 12:05 PM
  4. [SOLVED] Scenarios
    By JosefS in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. Scenarios
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 AM
  6. [SOLVED] Scenarios
    By JosefS in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. [SOLVED] Scenarios
    By JosefS in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

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