+ Reply to Thread
Results 1 to 10 of 10

IF + VLOOKUP: easier method?

  1. #1
    Registered User
    Join Date
    06-27-2016
    Location
    New York, NY
    MS-Off Ver
    2016
    Posts
    7

    IF + VLOOKUP: easier method?

    Hi all,

    I currently have a spreadsheet where I have a lookup of client name to another tab. However, if the client has certain name, I have it vlooking up to a sub-client in another tab. However, it looks like I'm entering too many conditions because I am now getting error message saying "This formula uses more levels of nesting than you can use in the current file format". Is there a way to shorten this formula?


    Here's how the formula currently looks:
    =IF(D27="STAR AGENCY",VLOOKUP(G27,Vlookup!$D:$F,2,FALSE),IF(D27="CIRCLE AGENCY",VLOOKUP(G27,Vlookup!$D:$F,2,FALSE),IF(D27="SQUARE AGENCY",VLOOKUP(G27,Vlookup!D:F,2,FALSE),IF(D27="DIAMOND AGENCY",VLOOKUP(G27,Vlookup!D:F,2,FALSE),IF(D27="TRIANGLE AGENCY",VLOOKUP(G27,Vlookup!D:F,2,FALSE),IF(D27="OVAL AGENCY",VLOOKUP(G27,Vlookup!$D:$F,2,FALSE),IF(D27="BLUE AGENCY",VLOOKUP(G27,Vlookup!$D:$F,2,FALSE),VLOOKUP(D27,Vlookup!$A:$B,2,FALSE))))))))
    Attached Images Attached Images
    Last edited by sugaswt17; 06-27-2016 at 12:29 PM.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF + VLOOKUP: easier method?

    Many members are unable to see images in the *.png format due to forum compatibility issues with some browsers.

    If you need to post an image post it in the *.jpg format.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: IF + VLOOKUP: easier method?

    Once a formula even "looks" like it's getting long you should consider using a lookup table.

    I can't quite see that image, hang let me get me microscope!
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    06-27-2016
    Location
    New York, NY
    MS-Off Ver
    2016
    Posts
    7

    Re: IF + VLOOKUP: easier method?

    Whoops, sorry I'm new here. Just included a text version of the formula to make it easier

  5. #5
    Registered User
    Join Date
    06-27-2016
    Location
    New York, NY
    MS-Off Ver
    2016
    Posts
    7

    Re: IF + VLOOKUP: easier method?

    Sorry, I just included a text version instead. And I already have a lookup table for my vlookup, but it seems there's too many conditions now.

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF + VLOOKUP: easier method?

    Try

    =IF(OR(D27={"STAR AGENCY","CIRCLE AGENCY","SQUARE AGENCY"}),VLOOKUP(G27,Vlookup!$D:$F,2,FALSE),VLOOKUP(D27,Vlookup!$A:$B,2,FALSE))

    Forgive me, I didn't take the time to write out ALL the possible values of D27 in within the {brackets}

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF + VLOOKUP: easier method?

    Here's one way...

    =IF(OR(D27={"STAR AGENCY","CIRCLE AGENCY","SQUARE AGENCY","DIAMOND AGENCY","TRIANGLE AGENCY","OVAL AGENCY","BLUE AGENCY"}),VLOOKUP(G27,Vlookup!$D:$F,2,0),VLOOKUP(D27,Vlookup!$A:$B,2,0))

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF + VLOOKUP: easier method?

    OR, if those are the ONLY possible "AGENCIES", try

    =IF(RIGHT(D27,6)="AGENCY",VLOOKUP(G27,Vlookup!$D:$F,2,0),VLOOKUP(D27,Vlookup!$A:$B,2,0))

  9. #9
    Registered User
    Join Date
    06-27-2016
    Location
    New York, NY
    MS-Off Ver
    2016
    Posts
    7

    Re: IF + VLOOKUP: easier method?

    THANK YOU SO MUCH EVERYONE!
    Knew it had to be super simple, just had no idea what the function was called!

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF + VLOOKUP: easier method?

    You're welcome. Thanks for the feedback!

+ 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] Alternative method to using sumif and vlookup
    By bkholy in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-28-2015, 09:42 AM
  2. Multiple Vlookup - must be an easier formula?
    By oldshape in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-03-2014, 08:26 AM
  3. [SOLVED] Which method is faster, VLOOKUP or MATCH & INDEX?
    By Jimmyjazz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-20-2013, 04:35 PM
  4. Custom vlookup or dependent Naming method
    By ezoecisoc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-18-2013, 04:28 AM
  5. Need help creating Vlookup formula for invoices ( or any other method)
    By BeanyBaby in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-15-2013, 11:43 PM
  6. vlookup or any other method...?
    By silverxx12 in forum Excel General
    Replies: 12
    Last Post: 06-17-2012, 10:31 AM
  7. Replacement method for 7+ IF statements? (tried VLOOKUP)
    By wenhao in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-31-2012, 10:04 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