+ Reply to Thread
Results 1 to 12 of 12

What is the best formula/function to get this result?

  1. #1
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164

    What is the best formula/function to get this result?

    I have a spreadsheet grouping employees to particular managers. What I want is to make a chart/database of which employees are under what managers, and then when an employee is selected from a drop down, it automatically generates the correct manager in another cell... what is the function/method best suited to do this in excel?

  2. #2
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164
    Also, it's important to mention that the lists of employees/managers are not listed on a chart or table within the spreadsheet cells, they are listed in a drop down.

  3. #3
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164
    any idea? I haven't found a best way to accomplish this yet.

  4. #4
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi,

    Easiest way is to use lookup or vlookup

    Ed

  5. #5
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164
    Quote Originally Posted by EdMac
    Hi,

    Easiest way is to use lookup or vlookup

    Ed
    thats what I had been reading though, however the data I'm using it not displayed on the worksheet, the managers are not listed in any column to reference from. How do you create.. lets say 4 managers with ~15 people under each and then reference that without that data ever been shown on the spreadsheet? Basically, I want to return the managers name when I enter the employees name, but have no list on the spreadsheet in view.

  6. #6
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    easiest way would be:

    create a new sheet - call it data

    In data make a list ot the employees say in A1:A50

    In B1:B50 put the manager's name of each employee

    Highlight the 2 lists, click on the name box (just above A1) and enter a name, say, manager- this names the table. You can now hide this sheet (format > sheet > hide)

    Now in the cell where you want the manager to appear put

    =if(iserror(vlookup(Employee_cell_reference,manager,2,false)),"",vlookup(Employee_cell_reference,manager,2,false)

    HTH

    Ed

    N

  7. #7
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164
    Thanks Ed.. I played around with your formula and I just dont see how it works.. I'm very confused about this.

    I've read the how to's, and nothing seems to explain it because they are always searching for numbers, not text.

    all I want to do is search a column for "thisword" when it's found, tell me what is next to it..

    so if it finds "this word" at A42, return B42... that's all I need

    in your formula what are the quotes for? whenever I type something in there it just returns that as the data every time. Also, I see what you mean by employee cell reference.. thats the cell in which I have the employees name.. say sam smith.. and then the next line is manager.. which I don't understand why we are searching the manager line when we should be searching the employee line and then looking adjacent to it...

    excuse the inexperience, it just seems like ridiculous overkill for what I'm trying to do.

    taking into account I have the data formatted exactly as you stated, how should the formula look?
    it looks as if we are searching for the same thing twice in your formula, I'm wanting it to just report the data in the adjacent cell to the one it found.
    Last edited by Pyrex238; 07-11-2007 at 12:18 PM.

  8. #8
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    what VLOOKUP does is

    You give it the emplyee name (Cell reference), it then looks in the table for that name and then finds the managers name in the next cell.

    The Iserror at the beginning says "if the emplyees name cell is blank or if you can't find it in the table, return a blank value.

    I have attached an example of how it works

    Ed
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164
    Quote Originally Posted by EdMac
    what VLOOKUP does is

    You give it the emplyee name (Cell reference), it then looks in the table for that name and then finds the managers name in the next cell.

    The Iserror at the beginning says "if the emplyees name cell is blank or if you can't find it in the table, return a blank value.

    I have attached an example of how it works

    Ed
    Thanks very much for your time on that, I see how your spreadsheet works.. but I'm still confused... is excel able to find that column, which is on a seperate sheet entirely, simply by the name and column number? Because that doesn't work on my spreadsheet... no matter what I reference, it never returns anything.

    my data is on sheet1, and sheet2 has my tables with managers/employees

  10. #10
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164
    here, look at my spreadsheet... I'm about to pull my hair out!!

    are you using a different method for your data sheet? maybe that is my issue.

    Funny, I'm able to program excel in VBA, but simple formulas confuse the hell out of me.

    I don't think it's finding anything on sheet2

    ... I just don't get it, I've run through your sheet and mine, and it should be working.
    Last edited by Pyrex238; 07-11-2007 at 03:02 PM.

  11. #11
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164
    hah! I had a typo in my name definition for the tables

    awesome! you are the man!

  12. #12
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi Pyrex,

    Glad you got there in the end and thanks for the feedback

    Ed

+ 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