+ Reply to Thread
Results 1 to 12 of 12

multiple IF statements in formula - exceeds max allowed

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    7

    multiple IF statements in formula - exceeds max allowed

    Hello,
    I am trying to make the following formula to work but I get: "This formula uses more levels of nesting than you can use in the current file format":

    =IF(BB23<=$BB$8,$AZ$8,IF(BB23<=$BB$9,$AZ$9,IF(BB23<=$BB$10,$AZ$10,IF(BB23<=$BB$11,$AZ$11,IF(BB23<=$BB$12,$AZ$12,IF(BB23<=$BB$13,$AZ$13,IF(BB23<=$BB$14,$AZ$14,IF(BB23<=$BB$15,$AZ$15,IF(BB23<=$BB$16,$AZ$16,IF(BB23<=$BB$17,$AZ$17,IF(BB23<=$BB$18,$AZ$18,IF(BB23<=$BB$19,$AZ$19,IF(BB23<=$BB$20,$AZ$20,IF(BB23<=$BB$21,$AZ$21,$AZ$22))))))))))))))

    Any suggestions on how I could simplify this multiple IF statement formula or break it down into two separate cells?

    Thanks in advance for any help provided.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: multiple IF statements in formula - exceeds max allowed

    You could try this approach instead:

    =IFERROR(INDEX($AZ$8:$AZ$21,MATCH(BB23,$BB$8:$BB$21)),$AZ$22)

    EXCEL 2007 and later supports more levels of nesting than you have, so perhaps you are using an .xls file rather than an .xlsx.

    Hope this helps.

    Pete

  3. #3
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: multiple IF statements in formula - exceeds max allowed

    Hi, for your Excel 2010, both formulas should work well

    Table formula
    =INDEX(AZ1:AZ200,MIN(IF(BB8:BB200>=BB23,ROW(BB8:BB200),"")))

    Normal formula
    =INDEX(AZ1:AZ200,AGGREGATE(15,6,ROW(8:100)/(BB8:BB100>=BB23),1))

    Regards.
    Last edited by maras_mak; 09-22-2018 at 04:50 PM.

  4. #4
    Registered User
    Join Date
    02-20-2013
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: multiple IF statements in formula - exceeds max allowed

    Thank you very much for your replies. I am not familiar with the functions that you are suggesting but unfortunately none are giving me the proper results.
    This is the data on the cell ranges:

    28moayu.jpg

    If BB23 = 9.10, I would expect the formula to return: B4 (condition being met: IF(BB23<=$BB$11,$AZ$11... )

    However,

    =IFERROR(INDEX($AZ$8:$AZ$21,MATCH(BB23,$BB$8:$BB$21)),$AZ$22) is returning B3

    =INDEX($AZ$8:$AZ$22,MIN(IF($BB$8:$BB$22>=BB29,ROW($BB$8:$BB$22),""))) is returning #VALUE!

    =INDEX($AZ$8:$AZ$22,AGGREGATE(15,6,ROW($8:$22)/($BB$8:$BB$22>=BB23),1)) is returning B11

    Maybe there is something else I would need to tweak in these formulas?
    By the way, the file was originally created in Excel 2013 and I am now editing it in Excel 2016, in .xlsx format, but I still get the "levels of nesting" error.

    Thank you,

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: multiple IF statements in formula - exceeds max allowed

    how about simply just this...
    INDEX($AZ$8:$AZ$22,MATCH(BB23,$BB$8:$BB$22,1))
    just a slight difference on what Pete gave you.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: multiple IF statements in formula - exceeds max allowed

    Still only gives B3, Sam
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: multiple IF statements in formula - exceeds max allowed

    @ animateme,
    look at the attachment. It seems to me, that both formulas meet your expectations.
    Regards.
    Attached Files Attached Files

  8. #8
    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,812

    Re: multiple IF statements in formula - exceeds max allowed

    @Maras_mak

    Sorry for the off-topic interjection:

    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

    Thanks!
    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.

  9. #9
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: multiple IF statements in formula - exceeds max allowed

    @ AliGW, here's my correction.

    Array formula (Ctrl + Shift + Enter)
    =IF(INDEX(AZ1:AZ22,MIN(IF(BB8:BB22>=BB23,ROW(BB8:BB22),"")))=0,AZ22,INDEX(AZ1:AZ22,MIN(IF(BB8:BB22>=BB23,ROW(BB8:BB22),""))))

    Normal formula
    =IFERROR(INDEX(AZ1:AZ22,AGGREGATE(15,6,ROW(8:22)/(BB8:BB22>=BB23),1)),AZ22)

    Regards.

  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,812

    Re: multiple IF statements in formula - exceeds max allowed

    Thank you.

  11. #11
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: multiple IF statements in formula - exceeds max allowed

    Quote Originally Posted by animateme View Post
    ... Maybe there is something else I would need to tweak in these formulas? ...
    Try this variation of my formula:

    =IF(BB3<=$BB$8,$AZ$8,IFERROR(INDEX($AZ$8:$AZ$21,MATCH(BB23,$BB$8:$BB$21,IF(ISNUMBER(MATCH(BB23,$BB$8:$BB$21,0)),0,1))),$AZ$22))

    Hope this helps.

    Pete

    EDIT: Next time, it would help if you attached a sample Excel workbook, rather than a picture of one.

  12. #12
    Registered User
    Join Date
    02-20-2013
    Location
    Mexico
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: multiple IF statements in formula - exceeds max allowed

    Thank you again for your responses.

    This is the one that worked perfectly:

    Normal formula
    =IFERROR(INDEX(AZ1:AZ22,AGGREGATE(15,6,ROW(8:22)/(BB8:BB22>=BB23),1)),AZ22)

    Thank you!!!

+ 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. [SOLVED] Returned Value Exceeds Max Allowed in Rating System
    By vill in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-27-2017, 03:08 PM
  2. Replies: 3
    Last Post: 10-17-2015, 05:42 PM
  3. Formula with multiple IF statements and IF AND statements
    By lottidotti in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-14-2013, 08:03 AM
  4. Display a message when a Cell value exceeds 75% of the total allowed expenditure
    By chamdan in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-15-2011, 12:38 AM
  5. Replies: 12
    Last Post: 05-15-2009, 08:38 AM
  6. how many if statements are allowed per cell?
    By DallasM in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-29-2005, 06:30 PM

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