+ Reply to Thread
Results 1 to 12 of 12

IF functions with Two conditions

  1. #1
    Registered User
    Join Date
    10-22-2020
    Location
    France
    MS-Off Ver
    Excel 2016
    Posts
    5

    IF functions with Two conditions

    Good morning,

    I have a request regarding an IF or IFS function. I want to compare columns of Grades and get a result. It goes like this:

    IF a student add a D in 2018 and a C,B,A in 2019, I want the cell to show Above expected.
    If a student add a D in 2018 and a D in 2019; I want the cell to show Expected.
    If a student add a C in 2018 and B,A, I want the cell to show Above expected.
    If a student add a C in 2018 and a C in 2019 I want the cell to show expected.
    If a student add a C in 2018 and a D in 2019, I want the cell to show False or anything.

    I tried a IFS with AND but it doesn't work all the time... I don't know if I'm very clear!

    I attached a file with my tests!

    Thank you!
    Attached Files Attached Files
    Last edited by Jkeatsooo; 10-22-2020 at 03:10 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: IF functions with Two conditions

    Please post a sample sheet '(see yellow banner). Thanks

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: IF functions with Two conditions

    In short,
    with grade A>B>C>D (excel translate it to be A<B<C<D)
    from 2018 to 2019:
    If same grade: "Expected"
    If promote: (D to A,B,C or C to A,B) "Above expected"
    If going down: False

    Is it true?

    If yes,
    With grade of 2018 and 2019 is in B2 and C2, try in D2:

    =IF(B2<C2,B2>C2,IF(B2=C2,"Expected","Above expected"))
    Attached Images Attached Images
    Quang PT

  4. #4
    Registered User
    Join Date
    10-22-2020
    Location
    France
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: IF functions with Two conditions

    Good morning,

    Thank you for your prompt reply. Yes it's almost it except that if B2 and C2=A, I want Above expected to appear. How can I can modify your formula to achieve that?

  5. #5
    Registered User
    Join Date
    10-22-2020
    Location
    France
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: IF functions with Two conditions

    And to add to the complexity(at least for me!), sometimes I don't have anything in the 2018(B) column. I don't want the D cell to show "False" in that case or have to manually remove anything.
    Last edited by Jkeatsooo; 10-22-2020 at 03:37 AM.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: IF functions with Two conditions

    OK, try again:

    Please Login or Register  to view this content.
    replace "missing" with anything you want to display.

  7. #7
    Registered User
    Join Date
    10-22-2020
    Location
    France
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: IF functions with Two conditions

    Thank you again. But it gives me "Above Expected" for B in B2 and C2 when I want Expected in that case.

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: IF functions with Two conditions

    It is giving me "Expected"
    from this...IF(AND(B2<>"A",B2=C2),"Expected"...
    If it still give you "Above", try upload image/ or file again
    Attached Images Attached Images

  9. #9
    Registered User
    Join Date
    10-22-2020
    Location
    France
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: IF functions with Two conditions

    Thank you!
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: IF functions with Two conditions

    The syntax is wrong:

    =IF(OR(B2="",C2=""),"missing",IF(B2<C2,B2>C2,IF(AND(B2<>"A",B2=C2),"Expected","Above expected")))
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  11. #11
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: IF functions with Two conditions

    D2 should be:

    =IF(C2="","Nouveau",IF(C2="new","True",IF(C2>=0.75,"A",IF(C2>=0.5,"B",IF(C2>=0.25,"C","D")))))

    And E2, you'd replaced "<>A" by "=A", and still using C instead of D.
    Use this in E2:
    Please Login or Register  to view this content.
    If it does not work, try to type in your expected outcome in those cells.
    Attached Files Attached Files

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: IF functions with Two conditions

    Quote Originally Posted by AliGW View Post
    The syntax is wrong:
    =IF(OR(B2="",C2=""),"missing",IF(B2<C2,B2>C2,IF(AND(B2<>"A",B2=C2),"Expected","Above expected")))
    Hi, instead of "FALSE", I am using logical statement to write "FALSE".

+ 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. MAX & MIN functions with conditions.....
    By Navin Agrawal in forum Excel General
    Replies: 2
    Last Post: 02-26-2018, 07:15 AM
  2. IF AND OR functions with VLOOKUP (2 conditions)
    By WalbertoEng in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-09-2016, 04:50 AM
  3. [SOLVED] Nested IF/AND functions... Multiple Conditions
    By jnswbc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-04-2016, 01:13 PM
  4. Stringing together AND and IF Functions (Multiple Conditions)
    By TiaTran in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-11-2013, 12:21 AM
  5. [SOLVED] Multiple Functions and conditions
    By Biocellguy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-25-2006, 04:50 PM
  6. Perform functions based on conditions met
    By 0-0 Wai Wai ^-^ in forum Excel General
    Replies: 4
    Last Post: 07-23-2005, 12:05 PM
  7. [SOLVED] Nested IF functions and 3 conditions
    By Dixie in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-22-2005, 12:06 AM

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