+ Reply to Thread
Results 1 to 16 of 16

64 Nesting level exceeded in IF Statement

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    Kansas City, MO
    MS-Off Ver
    Excel 2010
    Posts
    10

    Question 64 Nesting level exceeded in IF Statement

    Far from an Excel expert, I have a business reporting need where I draw from a few data sources I have to piece together information, kept in three different formats, to interpret either:
    1. employee initials (i.e. ACM)
    2. employee name (i.e. August Miles) or
    3. employee name and brackets (i.e. MILES, AUGUST {ACM})
    I have built a monstrosity of an IF statement that cycles through all possibilities and outputs one standard name convention depending on the name format mentioned above like this: MILES, A.C..

    This monstrosity of a statement worked well until I exceeded the 64 Nesting level limit today. I have heard/read that rewriting this statement as an ARRAY/VLOOKUP could be a better, much more efficient and cleaner way to achieve this same final result. Initial searches through the forum and on YouTube haven't yet led me to a means of accomplishing this so I thought I'd ask here if someone has an ideal of how best to accomplish my end objective.

    For posterity, as well as the collective horror of the group, here is the IF statement I've been using. (I apologize in advance...)
    =IF($F$2:$F$1048576="MILES, AUGUST {ACM}","Miles, A.",IF($F$2:$F$1048576="AMM","Montgomery, A.M.",IF($F$2:$F$1048576="GOGAN, BERT {BEG}","GOGAN, B.E.",IF($F$2:$F$1048576="PARK, BOO {BHP}","PARK, B.H.",IF($F$2:$F$1048576="HURT, BRIAN {BJH}","HURT, B.J.",IF($F$2:$F$1048576="NORTON, BRYCE {BJN}","NORTON, B.J.",IF($F$2:$F$1048576="BOLTON, BINKY {BKB}","BOLTON, B.K.",IF($F$2:$F$1048576="BAKER, BRENT {BMB}","BAKER, B.M.",IF($F$2:$F$1048576="PENN, CYNTHIA {CLP}","PENN, C.",IF($F$2:$F$1048576="CMH","NAME UNKNOWN",IF($F$2:$F$1048576="EVERETT, DAVID {DME}","EVERETT, D.M.",IF($F$2:$F$1048576="BUDDEMEYER, DAMIAN {DTB}","BUDDEMEYER, D.",IF($F$2:$F$1048576="JACKSON, EVERETT {EEJ}","JACKSON, E.",IF($F$2:$F$1048576="BLAIR, GLEN {GMB}","BLAIR, G.M.",IF($F$2:$F$1048576="HENSON, GLEN {GXH}","HENSON, G.",IF($F$2:$F$1048576="LITTLEJOHN, HARRY {HGL}","LITTLEJOHN, H.G.",IF($F$2:$F$1048576="DULLE, HUGH {HJD}","DULLE, H.J.",IF($F$2:$F$1048576="CLUTTS, JOSH {JAC}","CLUTTS, .J.",IF($F$2:$F$1048576="JAF","FOSTER, J.A.",IF($F$2:$F$1048576="RADER, JASON {JER}","RADER, J.E.",IF($F$2:$F$1048576="SHAW, JONATHAN {JES}","SHAW, J.",IF($F$2:$F$1048576="GEIST, JOSHUA {JJG}","GEIST, J.",IF($F$2:$F$1048576="JOHNSON, JEREMIAH {JLJ}","JOHNSON, J.L.",IF($F$2:$F$1048576="DUTTON, JOHN {JPD}","DUTTON, J.",IF($F$2:$F$1048576="CATON, JARED {JRC}","CATON, J.R.",IF($F$2:$F$1048576="MARTY, JEFF {JSM}","MARTY, J.S.",IF($F$2:$F$1048576="CHANDLER, JASON {JVC}","CHANDLER, J.V.",IF($F$2:$F$1048576="PARK, JOEY {JWP}","PARK, J.W.",IF($F$2:$F$1048576="TURNER, JEFF {JWT}","TURNER, J.",IF($F$2:$F$1048576="HOLMES, KENNIE {KDH}","HOLMES, K.D.",IF($F$2:$F$1048576="PANNELL, KEUSI {KLP}","PANNELL, K.L.",IF($F$2:$F$1048576="GINGERICH, MENNO {MAG}","GINGERICH, M.A.",IF($F$2:$F$1048576="HAHN, MIKE {MAH}","HAHN, M.A.",IF($F$2:$F$1048576="MOORE, MIKAL {MSM}","MOORE, M.S.",IF($F$2:$F$1048576="WEBB, PAUL {PVW}","WEBB, P.V.",IF($F$2:$F$1048576="MARSHALL, RYAN {RBM}","MARSHALL, R.",IF($F$2:$F$1048576="ZEILER, RACHAEL {RMZ}","ZEILER, R.M.",IF($F$2:$F$1048576="REED, SUSAN {SDR}","REED, S.D.",IF($F$2:$F$1048576="MATTHEWS, GRANT {SGM}","MATTHEWS, S.G.",IF($F$2:$F$1048576="ENGLAND, SHONDA {SLE}","ENGLAND, S.L.",IF($F$2:$F$1048576="GROTE, SUSAN {SMG}","GROTE, S.M.",IF($F$2:$F$1048576="KEELING, STEVEN {SMK}","KEELING, S.M.",IF($F$2:$F$1048576="BURTON, TRAVIS {TWB}","BURTON, T.W.",IF($F$2:$F$1048576="JONES, TODD {TWJ}","JONES, T.W.",IF($F$2:$F$1048576="RAY, SCOTT {WSR}","RAY, W.S.",IF($F$2:$F$1048576="CLEMENTS, DENNIS {DRC}","CLEMENTS, D.R.",IF($F$2:$F$1048576="HAYS, CHRISTYNE {CMH}","HAYS, C.",IF($F$2:$F$1048576="HOAGLAND, DUSTIN {DRH}","HOAGLAND, D.",IF($F$2:$F$1048576="MONTGOMERY, AMANDA {AMM}","MONTGOMERY A., A.C.",IF($F$2:$F$1048576="FLINT, AUGUST {ACF}","FLINT, A.C.",IF($F$2:$F$1048576="BILHIMER, MARK {MAB}","BILHIMER, M.A.",IF($F$2:$F$1048576="CARTWRIGHT, JUSTIN {JLC}","CARTWRIGHT, J.L.",IF($F$2:$F$1048576="MABRY, BRAD {BWM}","MABRY, B.W.",IF($F$2:$F$1048576="REED, ELLEN {EMR}","REED, E.R.",IF($F$2:$F$1048576="MARONEY, KEVIN {KDM}","MARONEY, K.D.",IF($F$2:$F$1048576="MUNOZ, ADRIAN {AXM}","MUNOZ, A.X.",IF($F$2:$F$1048576="MITCHELL, MELVIN {MWM}","MITCHELL, M.W.",IF($F$2:$F$1048576="BLACKWELL, CHRIS {CSB}","BLACKWELL, C.S.",IF($F$2:$F$1048576="MCCUNE, ANDY {ACM}","MCCUNE, A.C.",IF($F$2:$F$1048576="ALDERMAN, AUSTIN {AJA}","ALDERMAN, A.J.",IF($F$2:$F$1048576="GREENWAY, JEFF {JMG}","GREENWAY, J.M.",IF($F$2:$F$1048576="PERKINS, KEVIN {KCP}","PERKINS, K.C.",IF($F$2:$F$1048576="FULCO, CHRIS {CAF}","FALCO, C.A.",IF($F$2:$F$1048576="CONDE, AJ {AJC}","CONDE, A.J.",IF($F$2:$F$1048576="","NO DISPATCHER LISTED")))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
    If anyone can help me retire this statement, I would be most grateful!

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

    Re: 64 Nesting level exceeded in IF Statement

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: 64 Nesting level exceeded in IF Statement

    Nice joke. If you seriously expect anyone to work through that....

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,826

    Re: 64 Nesting level exceeded in IF Statement

    I would probably build a lookup table and use a lookup function. One column (lookup column) contains all of the different variations, and the second column contains the standard you want to return. VLOOKUP() is probably the most common starting place to learn about lookup functions: https://support.office.com/en-us/art...8-93a18ad188a1
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    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,428

    Re: 64 Nesting level exceeded in IF Statement

    List the options in a table and use a VLOOKUP function.
    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


  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: 64 Nesting level exceeded in IF Statement

    Hi Tony,

    I believe your huge formula can be done with a VLookup() function. If you were using Excel 2016 you might also use the Switch() function.

    See if this video works.
    https://exceljet.net/tips/how-to-use...-of-nested-ifs

    or
    http://searchfinancialapplications.t...s-with-VLOOKUP
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    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,929

    Re: 64 Nesting level exceeded in IF Statement

    Just to add my comment here too, you would be best served using a small table and vlookup
    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

  8. #8
    Registered User
    Join Date
    01-23-2013
    Location
    Kansas City, MO
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: 64 Nesting level exceeded in IF Statement

    Quote Originally Posted by Glenn Kennedy View Post
    Nice joke. If you seriously expect anyone to work through that....
    I was trying to be a bit light hearted through my frustrations with this as I'm far from an expert but I didn't mean for my message to come off as a joke. I have looked at the suggested posting standards and tried to be comprehensive in explaining, what my business need, the data inputs I receive, the desired output and the code I had used to date. If my post read other than that, I apologize as I appreciate the time and effort and quality of help I typically receive from Administrators such as yourself.

    Regards... Tony
    Last edited by jeffreybrown; 04-17-2017 at 05:48 PM. Reason: Removed full quote

  9. #9
    Registered User
    Join Date
    01-23-2013
    Location
    Kansas City, MO
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: 64 Nesting level exceeded in IF Statement

    MarvinP,

    Many, many thanks for this post. I received several responses to my query that were spot on but this video here helped me get my novice mind around the task at hand and taught me a valuable trick for the arsenal! I had pressed the add reputation button but thanks again. This reply was supremely helpful!
    Last edited by jeffreybrown; 04-17-2017 at 05:47 PM. Reason: Removed quote

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

    Re: 64 Nesting level exceeded in IF Statement

    This might help as a worked example with your data.
    Attached Files Attached Files

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: 64 Nesting level exceeded in IF Statement

    No offence was intended. If any was taken, I apologise. I was also being light hearted as that monster is impossible to follow. Rather than trying to dissect it, a sample file and a definition of your criteria would be much more useful.

  12. #12
    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,929

    Re: 64 Nesting level exceeded in IF Statement

    Happy to help and thanks for the feedback. Shout if you need more assistance?

  13. #13
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: 64 Nesting level exceeded in IF Statement

    Please see the attachment where I have created the table for you and used the below formula in column F to get the desired result :
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You need the below table :
    Name Name Format
    MILES, AUGUST {ACM} Miles, A.
    AMM Montgomery, A.M.
    GOGAN, BERT {BEG} GOGAN, B.E.
    PARK, BOO {BHP} PARK, B.H.
    HURT, BRIAN {BJH} HURT, B.J.
    NORTON, BRYCE {BJN} NORTON, B.J.
    BOLTON, BINKY {BKB} BOLTON, B.K.
    BAKER, BRENT {BMB} BAKER, B.M.
    PENN, CYNTHIA {CLP} PENN, C.
    CMH NAME UNKNOWN
    EVERETT, DAVID {DME} EVERETT, D.M.
    BUDDEMEYER, DAMIAN {DTB} BUDDEMEYER, D.
    JACKSON, EVERETT {EEJ} JACKSON, E.
    BLAIR, GLEN {GMB} BLAIR, G.M.
    HENSON, GLEN {GXH} HENSON, G.
    LITTLEJOHN, HARRY {HGL} LITTLEJOHN, H.G.
    DULLE, HUGH {HJD} DULLE, H.J.
    CLUTTS, JOSH {JAC} CLUTTS, .J.
    JAF FOSTER, J.A.
    RADER, JASON {JER} RADER, J.E.
    SHAW, JONATHAN {JES} SHAW, J.
    GEIST, JOSHUA {JJG} GEIST, J.
    JOHNSON, JEREMIAH {JLJ} JOHNSON, J.L.
    DUTTON, JOHN {JPD} DUTTON, J.
    CATON, JARED {JRC} CATON, J.R.
    MARTY, JEFF {JSM} MARTY, J.S.
    CHANDLER, JASON {JVC} CHANDLER, J.V.
    PARK, JOEY {JWP} PARK, J.W.
    TURNER, JEFF {JWT} TURNER, J.
    HOLMES, KENNIE {KDH} HOLMES, K.D.
    PANNELL, KEUSI {KLP} PANNELL, K.L.
    GINGERICH, MENNO {MAG} GINGERICH, M.A.
    HAHN, MIKE {MAH} HAHN, M.A.
    MOORE, MIKAL {MSM} MOORE, M.S.
    WEBB, PAUL {PVW} WEBB, P.V.
    MARSHALL, RYAN {RBM} MARSHALL, R.
    ZEILER, RACHAEL {RMZ} ZEILER, R.M.
    REED, SUSAN {SDR} REED, S.D.
    MATTHEWS, GRANT {SGM} MATTHEWS, S.G.
    ENGLAND, SHONDA {SLE} ENGLAND, S.L.
    GROTE, SUSAN {SMG} GROTE, S.M.
    KEELING, STEVEN {SMK} KEELING, S.M.
    BURTON, TRAVIS {TWB} BURTON, T.W.
    JONES, TODD {TWJ} JONES, T.W.
    RAY, SCOTT {WSR} RAY, W.S.
    CLEMENTS, DENNIS {DRC} CLEMENTS, D.R.
    HAYS, CHRISTYNE {CMH} HAYS, C.
    HOAGLAND, DUSTIN {DRH} HOAGLAND, D.
    MONTGOMERY, AMANDA {AMM} MONTGOMERY A., A.C.
    FLINT, AUGUST {ACF} FLINT, A.C.
    BILHIMER, MARK {MAB} BILHIMER, M.A.
    CARTWRIGHT, JUSTIN {JLC} CARTWRIGHT, J.L.
    MABRY, BRAD {BWM} MABRY, B.W.
    REED, ELLEN {EMR} REED, E.R.
    MARONEY, KEVIN {KDM} MARONEY, K.D.
    MUNOZ, ADRIAN {AXM} MUNOZ, A.X.
    MITCHELL, MELVIN {MWM} MITCHELL, M.W.
    BLACKWELL, CHRIS {CSB} BLACKWELL, C.S.
    MCCUNE, ANDY {ACM} MCCUNE, A.C.
    ALDERMAN, AUSTIN {AJA} ALDERMAN, A.J.
    GREENWAY, JEFF {JMG} GREENWAY, J.M.
    PERKINS, KEVIN {KCP} PERKINS, K.C.
    FULCO, CHRIS {CAF} FALCO, C.A.
    CONDE, AJ {AJC} CONDE, A.J.
    Attached Files Attached Files
    Last edited by sanram; 04-18-2017 at 01:44 AM. Reason: Attachment missing

  14. #14
    Registered User
    Join Date
    01-23-2013
    Location
    Kansas City, MO
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: 64 Nesting level exceeded in IF Statement

    Quote Originally Posted by Glenn Kennedy View Post
    No offence was intended. If any was taken, I apologise. I was also being light hearted as that monster is impossible to follow. Rather than trying to dissect it, a sample file and a definition of your criteria would be much more useful.
    None taken whatsoever. I simply wanted to add clarification as both a) written word doesn't always convey context as intended and b) I am always grateful for this community as I learn a great deal here. Thanks again to all who helped me learn to use VLOOKUP better yesterday...

    Cheers... Tony

  15. #15
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: 64 Nesting level exceeded in IF Statement

    You are most welcome and thanks for the rep.

  16. #16
    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,428

    Re: 64 Nesting level exceeded in IF Statement

    Ditto: You're welcome. Thanks for the rep.

+ 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: 4
    Last Post: 02-26-2015, 06:10 AM
  2. [SOLVED] Have I exceeded nesting limit
    By Bernie Deitrick in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 05:05 PM
  3. [SOLVED] Have I exceeded nesting limit
    By KeLee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  4. [SOLVED] Have I exceeded nesting limit
    By KeLee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  5. [SOLVED] Have I exceeded nesting limit
    By KeLee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  6. [SOLVED] Have I exceeded nesting limit
    By Bernie Deitrick in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 06:05 AM
  7. Have I exceeded nesting limit
    By KeLee in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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.6.0 RC 1