+ Reply to Thread
Results 1 to 6 of 6

How many levels of an IF statement is allowed within a Nested IF?

  1. #1
    Rick
    Guest

    How many levels of an IF statement is allowed within a Nested IF?

    I need to test different issue's within a cell. Here is an example. When I
    speak of levels it is in reference to actual levels not the number of IF's.

    =IF($G5="M","T1",0)
    "T1"
    IF(OR(YEAR($B5)=$AU$3,$F5="Full",$F5="BMP",$F5="CBC",$F5="RVP",$F5="UA"),0,"F2")
    " F2" IF($H5="D","T3","F3")
    "T3" IF($U5="Yes",$AV326,"F4")
    "F4" IF($B5>RollUp!$AR$15,0,"F5")
    "F5" IF($B5<RollUp!$AR$15,$K5,"F6")
    "F6" IF(SUM(Activity!$AM$326+$K5)<RollUp!$AT$6,$K5,SUM($K11*0.2))
    -------------------------------------------------------------------------------------------------
    "F3" IF($U5="Yes",$AE326,"F4A")
    "F4A" IF($B5>RollUp!$AR$15,0,"F5A")
    "F5A" IF($B5<RollUp!$AR$15,$K5,"F6A")
    "F6A" IF(SUM(Activity!$V$326+$K5)<RollUp!$AR$4,$K5, SUM($K11*0.2))


  2. #2
    kassie
    Guest

    RE: How many levels of an IF statement is allowed within a Nested IF?

    Not at all clear what you are trying to achieve here! What are "F2" etc
    referring to? Are these different cells, or are these different values? are
    you trying to say that if the result of your IF statement is "F2", you want
    further analysis on the result, or what? I suggest you provide a bit more
    detail, so that your question can be understood.

    "Rick" wrote:

    > I need to test different issue's within a cell. Here is an example. When I
    > speak of levels it is in reference to actual levels not the number of IF's.
    >
    > =IF($G5="M","T1",0)
    > "T1"
    > IF(OR(YEAR($B5)=$AU$3,$F5="Full",$F5="BMP",$F5="CBC",$F5="RVP",$F5="UA"),0,"F2")
    > " F2" IF($H5="D","T3","F3")
    > "T3" IF($U5="Yes",$AV326,"F4")
    > "F4" IF($B5>RollUp!$AR$15,0,"F5")
    > "F5" IF($B5<RollUp!$AR$15,$K5,"F6")
    > "F6" IF(SUM(Activity!$AM$326+$K5)<RollUp!$AT$6,$K5,SUM($K11*0.2))
    > -------------------------------------------------------------------------------------------------
    > "F3" IF($U5="Yes",$AE326,"F4A")
    > "F4A" IF($B5>RollUp!$AR$15,0,"F5A")
    > "F5A" IF($B5<RollUp!$AR$15,$K5,"F6A")
    > "F6A" IF(SUM(Activity!$V$326+$K5)<RollUp!$AR$4,$K5, SUM($K11*0.2))
    >


  3. #3
    Rick
    Guest

    RE: How many levels of an IF statement is allowed within a Nested

    Kassie:
    The "T1" or "F1" and so on, is the True or False condition of the parent if.
    So I put those indicators in from of the "if statement" so that you can tell
    by assembling the nested if where the next if was to be placed. The "T3" and
    "F3" level is where I am trying to find out from someone who has expert
    knowlege of VB which excel is written in. If when one says level 3 of a
    nested if and there are 2 ways to go,(True, and False). If one path is the
    true, for level 4 thru 7, and also is the path for false, leve 4 thru 7?
    IF($H5="D","T3","F3") is a true split of the nested if.
    Thanks
    Rick


    "kassie" wrote:

    > Not at all clear what you are trying to achieve here! What are "F2" etc
    > referring to? Are these different cells, or are these different values? are
    > you trying to say that if the result of your IF statement is "F2", you want
    > further analysis on the result, or what? I suggest you provide a bit more
    > detail, so that your question can be understood.
    >
    > "Rick" wrote:
    >
    > > I need to test different issue's within a cell. Here is an example. When I
    > > speak of levels it is in reference to actual levels not the number of IF's.
    > >
    > > =IF($G5="M","T1",0)
    > > "T1"
    > > IF(OR(YEAR($B5)=$AU$3,$F5="Full",$F5="BMP",$F5="CBC",$F5="RVP",$F5="UA"),0,"F2")
    > > " F2" IF($H5="D","T3","F3")
    > > "T3" IF($U5="Yes",$AV326,"F4")
    > > "F4" IF($B5>RollUp!$AR$15,0,"F5")
    > > "F5" IF($B5<RollUp!$AR$15,$K5,"F6")
    > > "F6" IF(SUM(Activity!$AM$326+$K5)<RollUp!$AT$6,$K5,SUM($K11*0.2))
    > > -------------------------------------------------------------------------------------------------
    > > "F3" IF($U5="Yes",$AE326,"F4A")
    > > "F4A" IF($B5>RollUp!$AR$15,0,"F5A")
    > > "F5A" IF($B5<RollUp!$AR$15,$K5,"F6A")
    > > "F6A" IF(SUM(Activity!$V$326+$K5)<RollUp!$AR$4,$K5, SUM($K11*0.2))
    > >


  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    I could be wrong but I have heard that you can have a max of 7 nested if statements

  5. #5
    Rick
    Guest

    Re: How many levels of an IF statement is allowed within a Nested

    Mudraker:
    That is true.... But if you look carefully, you'll see that there are 2
    different paths for the level 3 to take. In both paths, there are a max of
    seven nested if's. Levels 1 and 2 are common for both paths. Nowhere in the
    manuals or in help, is there a true explaination of the level therory.
    Rick

    "mudraker" wrote:

    >
    > I could be wrong but I have heard that you can have a max of 7 nested if
    > statements
    >
    >
    > --
    > mudraker
    > ------------------------------------------------------------------------
    > mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
    > View this thread: http://www.excelforum.com/showthread...hreadid=536904
    >
    >


  6. #6
    Rick
    Guest

    Re: How many levels of an IF statement is allowed within a Nested



    "Rick" wrote:

    > Mudraker:
    > That is true.... But if you look carefully, you'll see that there are 2
    > different paths for the level 3 to take. In both paths, there are a max of
    > seven nested if's. Levels 1 and 2 are common for both paths. Nowhere in the
    > manuals or in help, is there a true explaination of the level therory. By the way this is the assembled IF statement, and it works very well. I just wanted an explaination of why it works, if only 7 if's can be in a calculation.


    =IF($G5="M",IF(OR(YEAR($B5)=$AU$3,$F5="Full",$F5="BMP",$F5="CBC",$F5="RVP",$F5="UA"),0,IF($H5="D",IF($U5="Yes",RollUp!$AU$11,IF($B5>=RollUp!$AR$11,0,IF($B5<RollUp!$AR$11,$K5,IF(SUM(Activity!$AM$326+$K5)<RollUp!$AT$6,$K5,SUM($K5*0.2))))),IF($U5="Yes",RollUp!$AU$12,IF($B5>=RollUp!$AR$12,0,IF($B5<RollUp!$AR$12,$K5,IF(SUM(Activity!$V$326+$K5)<RollUp!$AT$4,$K5,SUM($K5*0.2))))))),0)
    > Rick
    >
    > "mudraker" wrote:
    >
    > >
    > > I could be wrong but I have heard that you can have a max of 7 nested if
    > > statements
    > >
    > >
    > > --
    > > mudraker
    > > ------------------------------------------------------------------------
    > > mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473
    > > View this thread: http://www.excelforum.com/showthread...hreadid=536904
    > >
    > >


+ 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