+ Reply to Thread
Results 1 to 5 of 5

Must be an easier way then a Nested If....

  1. #1
    Registered User
    Join Date
    08-16-2013
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    4

    Must be an easier way then a Nested If....

    Hello Everyone,

    First time posting, but have learned a lot since finding this forum. Now my issue is basically finding certain words within a field and assigning it the code that corresponds to that word. Pretty simple but the problem is my database for the words & codes is ever growing and the only way I got the statement to filter through all the words was a couple of 63 lined Nested If's (rows 2 -> 64 on formula, 65 -> 127 the second, so on & so forth) I'm assuming VBA would have a simple solution with arrays involved but I haven't learned that yet (Been meaning to get into it but life has been heck-tick) So would there be a formula solution to this?

    Thank You,
    Jack J.



    Sample Nested If Statement.xlsx

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Must be an easier way then a Nested If....

    Hi,

    You can do all that searching by combining it all into one array formula (confirm with CTRL+SHIFT+ENTER, not just ENTER). So, in B2 and copy down:

    =IFERROR(INDEX(Sheet2!$B$2:$B$10,MATCH(TRUE,ISNUMBER(SEARCH(Sheet2!$A$2:$A$10,Sheet1!A2)),0)),"")

    Edit: in fact, you can do this with a non-array version as well (preferable):

    =IFERROR(INDEX(Sheet2!$B$2:$B$10,MATCH(TRUE,INDEX(ISNUMBER(SEARCH(Sheet2!$A$2:$A$10,Sheet1!A2)),,),0)),"")

    Regards
    Last edited by XOR LX; 08-18-2013 at 03:58 PM.
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    08-16-2013
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Must be an easier way then a Nested If....

    Worked like a charm!! Thank you!! Never really thought of using Index in that way!!

  4. #4
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Must be an easier way then a Nested If....

    The only trouble with similar questions is to get the right word.
    What if yo had Swig?
    (BTW your Wig in Sheet2 has space after g so is not found by formula)

    Look here for VBA solution that take Exact word:
    http://www.excelfox.com/forum/f22/fi...ther-word-603/
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Must be an easier way then a Nested If....

    "Worked like a charm!! Thank you!! Never really thought of using Index in that way!!"

    You're welcome, and yes, it certainly is a surprisingly flexible beast, INDEX. To quote Daniel Ferry at the excellent Excel Hero site:

    "From my perspective, the Excel INDEX function is the single most important in the roster of Microsoft Excel functions."

    Regards

+ 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. There must be an easier way...
    By elfishio in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-19-2011, 11:39 PM
  2. Nested IF (an easier way?)
    By LPH in forum Excel General
    Replies: 5
    Last Post: 03-21-2009, 08:07 PM
  3. Easier said than done
    By Gordon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2006, 07:10 AM
  4. [SOLVED] Easier nested subtotals in Excel
    By Zsolt Dubovanszky in forum Excel General
    Replies: 2
    Last Post: 05-05-2006, 09:15 AM
  5. There's Got to be an Easier Way
    By Sprint54 in forum Excel General
    Replies: 7
    Last Post: 02-08-2006, 08:10 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