+ Reply to Thread
Results 1 to 13 of 13

Listing Employees by Area Code

  1. #1
    Registered User
    Join Date
    05-01-2010
    Location
    Durham
    MS-Off Ver
    Excel 2007
    Posts
    6

    Listing Employees by Area Code

    Hi all,

    I am in need to some help with Excel 2007 if possible

    I need to be able to create a method of showing which employees are based in which area code.

    An example, to make it a bit clearer is to list, the employees Unique Number, their name, age and length of service in a table that ranges from C6:F17 with the required information when a combo box at the top of the table can be manually changed between the area codes available.

    I have thought of using a VLookup to get the required information, but I couldnt figure out how to make it list the examples of all the employees. Could it be VBA code?

    Chris
    Last edited by carsey; 05-05-2010 at 03:41 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Listing Employees by Area Code

    post an example
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: Listing Employees by Area Code

    The simplest technique is to turn on the Data > Filter > Autofilter on this data set and then filter that area code column by the area code of interest rather than a combobox. It has the benefit of being simple.
    _________________
    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!)

  4. #4
    Registered User
    Join Date
    05-01-2010
    Location
    Durham
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Listing Employees by Area Code

    Thanks for the messages.

    I really need it to filter the data using the combo box at the top as seen in the screenshot.

    An example is below:

    \1

    The employee details are all stored in a separate sheet.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Listing Employees by Area Code

    so you are trying for 2 criteria manager and area? really need to see the actual layout in a workbook. or just do a mock up with fictitious data

  6. #6
    Registered User
    Join Date
    05-01-2010
    Location
    Durham
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Listing Employees by Area Code

    Cheers.

    I uploaded the workbook for you to have a look. Its the form in the AreaStaff sheet and the data needs to be pulled and filtered from the StaffData sheet.

    Basically, I need a method of listing the employee numbers based on the single area code selected in C3. Then I can do a Vlookup on the employees unique number to get the rest of the data.

    Cheers
    Attached Files Attached Files

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Listing Employees by Area Code

    here's how i'd approach it i extended the named range lookup employees to include column B
    fixed your vlook ups to include "false" option so as to find an exact match
    and inserted a helper column to look up from on sheet staff data. i would probably done it slightly different from scratch but i just worked with what you have already done.
    i couldn't do grade/ salary/bonus rate columns as i don't know where that data is!
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-01-2010
    Location
    Durham
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Listing Employees by Area Code

    Cheers for that!. Works like a charm.

    Now, i have created a IF and AND function to work out which grade the employee needs to be assigned.

    This is the criteria
    G1: Under 21 and less than 4 years service
    G2: 21 or more and less than 4 years service
    G3: 21 or more with more than 4 years service
    G4: 52 or more with 24 or more years service
    The formula I current have is:

    =IF(AND((E6<21),(F6<4)),"G1",IF(AND((E6>=21),(F6<4)),"G2",IF(AND((E6>=21),(F6>=4),(F6<=24)),"G3",IF(AND((E6>=52),(F6>=24)),"G4",FALSE))

    Which works, but not fully.
    The problem is, that if someone is under 52 years old and has more than 24 years service, the cell returns FALSE.

    What do I need to add into my formula to make it look for the right values.

    Chris

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Listing Employees by Area Code

    what should it = then if under 52 years old and has more than 24 years service?

  10. #10
    Registered User
    Join Date
    05-01-2010
    Location
    Durham
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Listing Employees by Area Code

    It should equal G3

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Listing Employees by Area Code

    =if(and((e6<21),(f6<4)),"g1",if(and((e6>=21),(f6<4)),"g2",if(and((e6>=52),(f6>=24)),"g4",if(and((e6>=21),(f6>=4)),"g3",false))))

  12. #12
    Registered User
    Join Date
    05-01-2010
    Location
    Durham
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Listing Employees by Area Code

    Cheers buddy! :D

  13. #13
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Listing Employees by Area Code

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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