+ Reply to Thread
Results 1 to 3 of 3

Creating a function to output a region based on a list of counties

  1. #1
    Registered User
    Join Date
    12-17-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    6

    Creating a function to output a region based on a list of counties

    Hi There! This seems to be an easy function to write but I am totally failing to figure it out on my own. I hope someone here can help me! Here is the problem:

    I have lists of counties that are associated with each of 4 regions of the state. So, for example North (Wise, Parker, Hood, . . .), South (Duvall, Webb, La Salle, . . .) and so on. For each of the 4 regions, there are 30+ counties listed.

    I would like to be able to write a single function to just output the region based on which county is listed in the cell.

    So, if A1 says "Hood" then A2 will say "North".

    Thanks (in advance) for your help!

    Jane

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Creating a function to output a region based on a list of counties

    Functions you can use for this are: VLOOKUP, INDEX/MATCH.

    Assuming the list of Counties in column A and for each entry the "region" it belongs to is listed in column B....

    Assuming E1 has "Hood" then this formula in F1 would lookup the region for you:

    =VLOOKUP(E1, A:B, 2, 0)


    Now, obviously you can move those things around or put the "list" on a separate sheet, just amend the formula accordingly.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-17-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Creating a function to output a region based on a list of counties

    Much appreciated! This is exactly what I needed. Thank you for your help!

+ 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. Creating Output Based on Row #
    By tommahh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2013, 05:02 PM
  2. Replies: 4
    Last Post: 05-17-2012, 06:30 PM
  3. current region row count question. Need help understanding output
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2011, 07:44 AM
  4. Replies: 1
    Last Post: 11-22-2010, 01:52 PM
  5. Output list based on value in a cell
    By vegan@ucom.net in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2006, 10:30 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