+ Reply to Thread
Results 1 to 6 of 6

Nested IF - Multiple Conditions question

  1. #1
    Registered User
    Join Date
    12-09-2014
    Location
    Providence, RI
    MS-Off Ver
    Excel 2010
    Posts
    16

    Nested IF - Multiple Conditions question

    So, I have a problem I think is simple enough to solve, but I can't figure it out.

    I'm looking for one column to identify whether or not the row falls into "Group A" or "Group B" based on two different sets of conditions.

    Column A will either say "Red" or "Blue" while column B will have a number. For an entry to fall into Group A it must be red and the number must be >= 10. For Group B, it must be Blue and >=5.


    I could do two separate formulas in different columns, i.e.: =IF((AND(B2>=10,A2="Red")),"Group A,"") , but I want to also identify Group B in the same formula.
    Last edited by kslattery; 05-29-2018 at 01:39 PM.

  2. #2
    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. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,663

    Re: Nested IF - Multiple Conditions question

    Try this:

    =IF((AND(B2>=10,A2="Red")),"Group A,IF(AND(B2>=5,A2="Blue","Group B",""))
    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.

  3. #3
    Registered User
    Join Date
    04-14-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Nested IF - Multiple Conditions question

    Let say in

    Cell A1:A2 Cell B1:B2 Cell C1:C2

    Red 12 =IF(AND(B1>=10,A1="Red"),"Group A","Group B")
    Blue 6 =IF(AND(B2>=10,A1="Red"),"Group A","Group B")

    Hope it helps.

    Rev12

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Nested IF - Multiple Conditions question

    Will there ever be an instance where column A is Red and column B is < 5? Or where column A is Blue and column B is < 10?

    If so, try this:

    =IF(AND(A2="Red",B2>=10),"Group A",IF(AND(A2="Blue",B2>=5),"Group B",""))

    The formula will return blank if neither condition is satisfied.

  5. #5
    Registered User
    Join Date
    12-09-2014
    Location
    Providence, RI
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Nested IF - Multiple Conditions question

    Quote Originally Posted by 63falcondude View Post
    Will there ever be an instance where column A is Red and column B is < 5? Or where column A is Blue and column B is < 10?

    If so, try this:

    =IF(AND(A2="Red",B2>=10),"Group A",IF(AND(A2="Blue",B2>=5),"Group B",""))

    The formula will return blank if neither condition is satisfied.
    Yes -- sorry, forgot to mention that. But your solution works perfectly. I see where I was messing up before, too. Still getting used to Nested IFs


    edit: Thank you to AliGW as well!

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Nested IF - Multiple Conditions question

    Glad we could help.

+ 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. Nested IF formula with multiple conditions
    By MTC2016 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-22-2017, 07:15 PM
  2. [SOLVED] Help! Need a solution for nested IF for multiple conditions.
    By Tracy Tan in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2016, 04:03 AM
  3. Nested IF formula with multiple conditions
    By DavidNg in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-27-2016, 06:24 AM
  4. [SOLVED] Nested IF/AND functions... Multiple Conditions
    By jnswbc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-04-2016, 01:13 PM
  5. Nested If loop with multiple conditions
    By schaasyd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2012, 08:16 AM
  6. Replies: 5
    Last Post: 07-14-2009, 11:22 AM
  7. Multiple conditions in nested IF statements
    By havfunonline2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-09-2009, 05:36 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