+ Reply to Thread
Results 1 to 5 of 5

Alternative to Nested IF Statement

Hybrid View

  1. #1
    Registered User
    Join Date
    03-02-2011
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    29

    Alternative to Nested IF Statement

    Hi all,

    I have been a victim of not being able to use the nested IF statement as I have too many IFs. I guess this will not be ideal using IF anyway.

    I was wondering if there was another way of getting the result using another Function or VBA possibly.

    My current formula looks like this

    =IF(E221="LON","London",IF(E221="B","Martlet",IF(E221="KN","Kent",IF(E221="NOR","Northside",IF(E221="NWE","Hillside",IF(E221="RKN","Kent",IF(E221="RS","Roundshaw",IF(E221="RHS","Martlet",,IF(E221="HSH","Southbank"""))))))))

    I think I must have about 30 codes in Column E where I need to group them to about 10.
    Last edited by ahs004; 08-02-2013 at 09:13 AM.

  2. #2
    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
    48,252

    Re: Alternative to Nested IF Statement

    Put the codes and descriptions into a table and then use VLOOKUP.

    =VLOOKUP(E221, Sheet2!$A:$B,2,FALSE)

    To check for missing entries in Excel 2003:

    =IF(ISNA(VLOOKUP(E221, Sheet2!$A:$B,2,FALSE)),"Not found",VLOOKUP(E221, Sheet2!$A:$B,2,FALSE))


    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


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

    Re: Alternative to Nested IF Statement

    Hi,

    If you put that data into a simple table, you could use a VLOOKUP. So, assuming your codes ("LON", "KN", etc.) are in cells A1:A30 (for example) and the corresponding entries in B1:30, then your formula would be:

    =VLOOKUP(E221,$A$1:$B$30,2,0)

    Regards
    Click * below if this answer helped

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

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Alternative to Nested IF Statement

    Try this...

    Formula: copy to clipboard
    =VLOOKUP(A4,{"LON","London";"B","Martlet";"KN","Kent";"NOR","Northside";"NWE","Hillside";"RKN","Kent";"RS","Roundshaw";"RHS","Martlet";"HSH","Southbank"},2,0)


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  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
    48,252

    Re: Alternative to Nested IF Statement

    Thanks for the rep.


    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. Alternative to Nested IF Statement
    By s1crock in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-16-2014, 06:13 PM
  2. Nested IF Statement Alternative
    By Gecks in forum Excel General
    Replies: 4
    Last Post: 02-07-2012, 02:40 PM
  3. Alternative to summing nested If's
    By mashley in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-09-2009, 09:37 AM
  4. alternative to too many nested IF statements
    By lintcoop in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-06-2009, 04:23 PM
  5. is there a db alternative to nested if then?
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-10-2009, 10:59 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