+ Reply to Thread
Results 1 to 2 of 2

Possible vlookup with nested formula to find data after multiple variables checked

  1. #1
    Registered User
    Join Date
    05-12-2014
    MS-Off Ver
    Excel 2003
    Posts
    1

    Exclamation Possible vlookup with nested formula to find data after multiple variables checked

    Okay, so I've been working with this most of the day and decided I needed help, and I'll probably be pushing my excel knowledge limits to the max over the next year so if anyone can help on this one it would be huge.


    Data looks like this:
    Sheet 1

    a - b - c
    AZ - lee county collection - blank
    AZ - bar county tax agency - blank
    AR - new county government - blank
    AR - lee county collection - blank
    NY - collection for cool county - blank
    CA - excel town and county collection - blank
    CA - another county collector - blank
    IL - lee county - blank

    Sheet 2
    a -b -c
    AZ - Lee county - code 38
    AZ - bar county - code 45
    AR - new county - code 37
    AR - lee county - code 66
    NY - cool county - code 55
    CA - excel county - code 41
    CA - another county - code 40
    IL - lee county - code 42

    I need a formula that will first look up a matching state and then only look at counties in that state and when a matching county is found return the code information in the next (3rd) column to column c in the first sheet. The issue is I also have to use a formula like vlookup that will allow for a "close enough" rule for the second part so that when it looks for lee county tax collector it can find just "lee county."

    Also I would use text to column to get the words I need to look at to be exact but as seen above some of the words aren't in order and there are over 22,000 that I need a formula I can just drag down.

    Can anyone help me out with this? I'd seriously appreciate it!!!

  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,050

    Re: Possible vlookup with nested formula to find data after multiple variables checked

    Hi and welcome to the forum

    The issue is I also have to use a formula like vlookup that will allow for a "close enough" rule
    That only applies to values, not text.

    This ARRAY formula will pull out most of the answers for you. However, your data format is inconsistent...
    =INDEX(Sheet2!$C$2:$C$9,MATCH(Sheet1!A2&LEFT(B2,FIND("county",B2,1)+5)&"*",Sheet2!$A$2:$A$9&Sheet2!$B$2:$B$9,0))


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    If you can ensure that the county and "county" are always at the beginning (unlike "collection for cool county"/cool county and excel town and county collection/excel county) then that should work for all of them
    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

+ 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] vlookup data with multiple variables in a table
    By Bax in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-01-2013, 09:33 AM
  2. Nested VLOOKUP & SUMIF in IF STATEMENT with several variables
    By sarahw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-30-2013, 02:47 PM
  3. Nested IF Formula Using Variables
    By Gard5096 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-08-2013, 02:36 PM
  4. Replies: 1
    Last Post: 06-23-2011, 03:28 AM
  5. Nested IFs formula to find matching values with multiple conditions
    By ghuang in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-25-2009, 02:02 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