+ Reply to Thread
Results 1 to 10 of 10

Too many nested functions

  1. #1
    Registered User
    Join Date
    06-19-2015
    Location
    Bradford
    MS-Off Ver
    2010
    Posts
    8

    Too many nested functions

    Hi,

    I wonder if someone could tell me how to condense this?

    =IF(X6=60,"30",IF(X6=90,"45",IF(X6=120,"60",IF(X6=150,"75",IF(X6=180,"90",IF(X6=210,"105",IF(X6=240,"120",IF(X6=270,"112.50",IF(X6=300,"125",IF(X6=330,"137.50",IF(X6=360,"150"),IF(X6=390,"162.5",IF(X6=420,"175",IF(X5=450,"187.50"))))))))))))))

    When I put this into Excel 2010, it tells me there are too many nested functions, but I don't know how else to get the same result?

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Too many nested functions

    Try ...

    =LOOKUP(X6,{60,90,120,0,0},{30,45,60,0,0})

    The zeros are place holders for the rest of the data do not put the numbers in quotes (" " ) UNLESS you want them as text,

  3. #3
    Registered User
    Join Date
    01-28-2014
    Location
    Brno
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Too many nested functions

    Place table below to A1:B14 and change formula to =lookup(X6,A1:A14,B1:B14). Please note values in column A must be sorted from smallest to largest.
    60 30
    90 45
    120 60
    150 75
    180 90
    210 105
    240 120
    270 112.5
    300 125
    330 137.5
    360 150
    390 162.5
    420 175
    450 187.5

    Another approach is using vlookup:
    With the same table: =vlookup(X6,A1:B14,2,false) - in this case values in column A doesn't need to be sorted.

    Btw, the problem with your formula is right bracket in this part of the formula: X6=360,"150") - if you remove the bracket, your formula will work. But I strongly recommend not to use so many nested functions.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Too many nested functions

    Hi

    Create a table, for example in B3:C15, and use
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    for the corresponding value of E3.

    Best regards

  5. #5
    Registered User
    Join Date
    08-04-2009
    Location
    Golborne England
    MS-Off Ver
    2013
    Posts
    85

    Re: Too many nested functions

    Try this it works on My 2013 version. You had one extra ")" after x6=360,"150".

    Please Login or Register  to view this content.
    JimBobBowie

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Too many nested functions

    Another option:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Too many nested functions

    Or, you could put the whole lookup table in the formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Too many nested functions

    And your original formula corrected:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-19-2015
    Location
    Bradford
    MS-Off Ver
    2010
    Posts
    8

    Re: Too many nested functions

    Hi All,

    thank you all for your help!

    This seems to be the easiest way for me to do it.

    =IFERROR(INDEX({30,45,60,75,90,105,120,112.5,125,137.5,150,162.5,175,187.5},MATCH(X6,{60,90,120,150,180,210,240,270,300,330,360,390,420,450},0)),"error")

    Thank you :D

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Too many nested functions

    You're welcome.




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Replies: 6
    Last Post: 03-17-2015, 01:35 AM
  2. to many nested if functions. NEED HELP
    By toothpastenerd in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-25-2013, 06:01 PM
  3. Nested functions HELP!
    By chiefnmd in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  4. Nested functions HELP!
    By chiefnmd in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] Nested functions HELP!
    By chiefnmd in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. [SOLVED] Nested Functions
    By Steve Almond in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-14-2005, 11:05 AM
  7. Nested Functions
    By Doyle Brunson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-02-2005, 08:23 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