+ Reply to Thread
Results 1 to 3 of 3

Generate List from Index Match that searches for a value in a field

  1. #1
    Registered User
    Join Date
    07-22-2014
    Location
    Denver, CO
    MS-Off Ver
    2007
    Posts
    3

    Question Generate List from Index Match that searches for a value in a field

    Good Afternoon Everyone,

    I was given a spreadsheet at work that contains a list of counties and the states they are in. What I am needing to do is generate a list of counties in a given state. The catch to this is that there are some counties in multiple states. In my spreadsheet I created a drop down list for the states. Upon selecting the state I have the State Abbreviation in another field. I also count the number of expected entries to be returned from the data set. I am able to return a list of counties in the selected state, however, it does not return the values of counties in multiple states.

    At the beginning of the data set if you look for Allentown-Bethlehem-Easton they reside in the states of PA-NJ, and Augusta-Richmond County is in GA-SC. Here are a few formulas I am using.

    My Drop down list for my states is located in E1, the State Abreviation is located in E2, and my formula for counting the number of expected entries is in E3. The formula for counting the expected number of entries is:

    =COUNTIF(CountyLocation,"*"&StateAbbrev&"*")

    CountyLocation is Column B of my data set, and StateAbbrev is a reference to E2.

    The formula for generating a list of returned values (starting in cell H1) is as follows:

    =IF(ROWS(H$1:H1)<=$E$5,INDEX(CountyName,SMALL(IF(CountyLocation=$E$2,ROW(CountyName)-ROW($A$2)+1),ROWS(H$1:H1))),"")

    CountyName is the name of the county from Column A, CountyLocation is Column B.


    If anyone can offer suggestions on how to get my INDEX function to match the state values in Column B it would be greatly appreciated.

    Thanks in advance.



    CountyStateExampleData.xlsx

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Generate List from Index Match that searches for a value in a field

    welcome to the forum, markslayman. you can use this array formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    to make it slightly faster, try deducting the ROW in the non array area:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    07-22-2014
    Location
    Denver, CO
    MS-Off Ver
    2007
    Posts
    3

    Re: Generate List from Index Match that searches for a value in a field

    Thank you very much benishiryo!

+ 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. Replies: 5
    Last Post: 07-06-2014, 11:51 AM
  2. Help using multiple Match searches in an index
    By kmo0034 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-30-2014, 03:32 AM
  3. [SOLVED] 2 or more Index Match Searches in one?
    By nobodyukno in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-12-2013, 01:48 PM
  4. [SOLVED] Index and match based off of top 5 list for a specific field in a filtered column
    By ScottBeatty in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-27-2013, 04:37 PM
  5. Replies: 1
    Last Post: 06-14-2013, 09:01 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