+ Reply to Thread
Results 1 to 8 of 8

IF Statement - 64 Levels of Nesting Breached

  1. #1
    Registered User
    Join Date
    07-24-2018
    Location
    New York, USA
    MS-Off Ver
    Office 2016
    Posts
    12

    IF Statement - 64 Levels of Nesting Breached

    Hello,

    I'm trying to categorize SKUs in my item list based on values defined in a table on Excel. I thought I had a solution until Excel gave me the error for maximum levels of IF nesting. The formula I was using goes along these lines:

    IF(ISNUMBER(SEARCH("Jack",$C4)),"JACK", IF(ISNUMBER(SEARCH("Cutting",$C4)),"CUTT", IF(ISNUMBER(SEARCH("Hammer",$C4)),"HMMR", IF(ISNUMBER(SEARCH("Lighting",$C4)),"LIGH", ..............

    I have a list of categories in column A and a list of 4-character values matching the category in column B.
    Ex: Hammer in Column A, HAMM in column B. I need a formula that will find the word "Hammer" (Column A) within a product description "Industrial Hammer Drill" ($C4), and attribute the value "HAMM" (Column B) to the item. The same idea applies for the near 500 categories that are in my spreadsheet.

    Thanks!!
    Last edited by mtob; 07-24-2018 at 05:09 AM.

  2. #2
    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
    81,091

    Re: IF Statement - 64 Levels of Nesting Breached

    Welcome to the forum!

    This is where you need to use a lookup table - set up a table with your full names on the left and your abbreviations on the right, then refer to it in a VLOOKUP formula:

    =VLOOKUP(C4,$A$2:$B$500,2,0)

    https://support.office.com/en-gb/art...8-93a18ad188a1
    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.

  3. #3
    Registered User
    Join Date
    07-24-2018
    Location
    New York, USA
    MS-Off Ver
    Office 2016
    Posts
    12

    Re: IF Statement - 64 Levels of Nesting Breached

    Hi Ali!

    Thank you for the warm welcome. Unfortunately, a simple vlookup doesn't cut it because I'm looking for a specific word within a string of text. Ex: I want to find the word "Hammer" withing the string of text "Industrial air hammer tool", and get a return value of "HAMM". How would you go about this?

  4. #4
    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
    81,091

    Re: IF Statement - 64 Levels of Nesting Breached

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are 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 results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as 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.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.

  5. #5
    Registered User
    Join Date
    07-24-2018
    Location
    New York, USA
    MS-Off Ver
    Office 2016
    Posts
    12

    Re: IF Statement - 64 Levels of Nesting Breached

    Here you go. I've uploaded a sample spreadsheet for you to see more clearly.

    Thank you very much!!
    Attached Files Attached Files

  6. #6
    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
    81,091

    Re: IF Statement - 64 Levels of Nesting Breached

    Try this in C2 copied down:

    =IFERROR(LOOKUP(1000,SEARCH($G$2:$G$6,B2),$H$2:$H$6),"")

  7. #7
    Registered User
    Join Date
    07-24-2018
    Location
    New York, USA
    MS-Off Ver
    Office 2016
    Posts
    12

    Re: IF Statement - 64 Levels of Nesting Breached

    Worked like a charm! Much appreciated Ali.

  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
    81,091

    Re: IF Statement - 64 Levels of Nesting Breached

    You're welcome!

    One of many little tricks I've learnt by being a member here.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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] ¨...more than 64 levels of nesting¨ Help?
    By 1.9tdiaxr in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 08-11-2022, 04:50 PM
  2. More levels of nesting than allowed
    By Gappy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2015, 04:17 PM
  3. IF statement nesting levels
    By rod642 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-23-2014, 10:53 AM
  4. [SOLVED] levels of nesting help
    By jamiemu in forum Excel General
    Replies: 4
    Last Post: 05-15-2012, 06:44 PM
  5. levels of nesting
    By buddydubbo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2011, 01:29 AM
  6. Levels of Nesting more than 7
    By Bigwilliewilcox in forum Excel General
    Replies: 5
    Last Post: 12-04-2010, 05:14 AM
  7. too many levels of nesting
    By gss in forum Excel General
    Replies: 7
    Last Post: 04-02-2009, 09:01 PM

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