+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    11-11-2009
    Location
    Seattle
    MS-Off Ver
    Excel 2007
    Posts
    2

    Nested IF functions

    Hi,

    I am trying to set up an IF function, and it has the following conditions:

    If A1=High & B1=Maximum then C1= High
    If A1=High & B1=Moderate then C1= High
    If A1=High & B1=Lowthen C1= Moderate
    If A1=Moderate/low & B1=Low then C1= Low
    If A1=Moderate/low & B1=Moderate then C1= Low
    If A1=Moderate/low & B1=Maximum then C1= Moderate

    Is there any way to put all of that together in a single function?

    Please Help!

  2. #2
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,042

    Re: Nested IF functions

    maybe this formula in C1

    Code:
    =IF(A1="High",IF(OR(B1="Maximum",B1="Moderate"),"High","Moderate"),IF(OR(B1="LOW",B1="Moderate"),"Low","Moderate"))

    assuming that A1 will only ever have either of the two values and B1 only ever have one of the three you listed.
    Last edited by teylyn; 11-11-2009 at 09:57 PM.
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  3. #3
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,140

    Re: Nested IF functions

    Teylyn, just an FYI: when you use long formulas, this system puts a space after every 100 characters. For that reason, it's often best to use code wrappers for them.

  4. #4
    Forum Moderator teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    2003 & 2010
    Posts
    10,042

    Re: Nested IF functions

    thanks, darkyam. added code tags above.
    teylyn
    Microsoft MVP - Excel
    At Excelforum, you can say "Thank you!" by clicking the icon below the post.

    Avoid pie charts with more than two data points. Why? See here (pdf, 559 kb). The only acceptable pie chart is here.

  5. #5
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,225

    Re: Nested IF functions

    How about:

    =IF(NOT(A1="High"), IF(B1="Maximum","Moderate","Low"), IF(B1="Low", "Moderate", "High"))

    (hat-tip to Teylyn)

    You should probably have a test to make sure the formula should run at all...something like:

    =IF(OR(A1="",B1=""), "", IF(NOT(A1="High"), IF(B1="Maximum","Moderate","Low"), IF(B1="Low", "Moderate", "High")))
    Last edited by JBeaucaire; 11-11-2009 at 10:11 PM.
    _________________
    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!)

  6. #6
    Registered User
    Join Date
    11-11-2009
    Location
    Seattle
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Nested IF functions

    Quote Originally Posted by teylyn View Post
    maybe this formula in C1

    Code:
    =IF(A1="High",IF(OR(B1="Maximum",B1="Moderate"),"High","Moderate"),IF(OR(B1="LOW",B1="Moderate"),"Low","Moderate"))

    assuming that A1 will only ever have either of the two values and B1 only ever have one of the three you listed.
    Teylyn,

    It worked! Thank you for your help!

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.2.0