+ Reply to Thread
Results 1 to 8 of 8

Formula to lookup data in selected table without nested IFs

  1. #1
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Formula to lookup data in selected table without nested IFs

    Hi,
    Does anyone have any ideas for the following:
    I have a formula that uses quite a few IFs all lined up, and I'd like to simplify it a bit, also I think there is a limit to how many IFs I can use.

    What the formula does is use the input from C2 to decide which table to VLOOKUP and find the data specified in A2, as long as there is text in A2.. Here's what I have:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    What I'm worried about is I'm going to have to add more clients, and therefore more tables, and I'm going to run out of functionality. I've already got a pretty long formula.

    I've attached an example spreadsheet. The variable data cells (A2 and C2) are validated by drop-down lists for convenience, the formula lives at B2, and the tables are located on Sheet2. The data validation named ranges are hidden in Sheet2, J:K, if you need them.

    I'm not against doing this with code if I have to.

    Thanks for your help.

    Example.xlsx
    Last edited by Jaron_t; 12-27-2012 at 07:45 PM.

  2. #2
    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
    53,049

    Re: Formula to lookup data in selected table without nested IFs

    Take a look at the attached and see if you can work with that? i removed the individual tables and combined them into 1, which can now grow. then I used index/match to find the required into.

    adjust the ranges as needed.
    Attached Files Attached Files
    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

  3. #3
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Formula to lookup data in selected table without nested IFs

    Yes I think that will work well. Nice and simple. Thanks!

  4. #4
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Formula to lookup data in selected table without nested IFs

    I should write a book called: "While I was typing"

    So, while I was typing, FD came along with something similar to what I was doing. As I've done the work, I might as well post it, as some may prefer the approach of including an IF function as part of the MATCH argument. (In describing what I've done, I've also described how this works, but if any further clarification is required, please just ask.)

    Hope this helps, and season's greets and peace to all.
    Attached Files Attached Files
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

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

    Re: Formula to lookup data in selected table without nested IFs

    lol sorry BB, but i think i could contribute to that book as well

    nice solution did you take a look at mine, its a bit simpler

  6. #6
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Formula to lookup data in selected table without nested IFs

    Come on, so - if we get cracking, we can have it out in time for the new year!

    I think there's a time & a place for RIGHT (LEFT, etc) skulduggery, but this isn't it - although there's every chance that if I were to use it repeatedly over a few weeks, I might change my mind. Familiarity breeds a new box of tricks for problem-solving, in this case, and not contempt!

  7. #7
    Registered User
    Join Date
    05-14-2012
    Location
    Alaska, USA
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Formula to lookup data in selected table without nested IFs

    Yes, thanks Brendan for your input. I think I'm going to go with the first solution though, since array formulas are a little over my head.

  8. #8
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Formula to lookup data in selected table without nested IFs

    Hi Jaron,

    Thanks for the feedback. For what it's worth, array formulas are really nothing to fear, but of course whatever works, works.

    All the best,

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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