Find people responsible for employees withing a hierachic structure in a company.

Son

Active Member
Joined
Mar 19, 2010
Messages
284
Hello, I need to automatically find the managers who will be responsible for each employee in a company. There are many hierarchy levels and each manager is responsible for his team of subordinates.

I have all the columns A - K and I need to fill in columns L-M-N with the names (or job title) of the people corresponding to each person, as in the following example.

I have no idea how to approach this. Data in columns A-K is from a pivot table based on the employees' database.

I have classified each person according to a hierarchy level.
For example CEO = level 1, Director = Level 2, Subdirector = level 3, managers = level 5. People in level 4, or levels 6, 7 and 8 are not responsible for any subordinates.

So, in column A I have all hierarchy levels and in columns B-K I have the hierachy level for each person.

Each SubDirector is only responsible for the people that work for him, the same goes for each manager etc.

I don't know if this makes any sense to you, but if it does, I would be really greatful for any suggestion you might have.

I'm looking forward to any thoughts or advice.

Thanks in advance!


A BCDEFGHIJKLMN
1ALLLEVEL 1LEVEL 2LEVEL 3LEVEL 5COMPANY STRUCTUREPEOPLE1ST2ND3RD
2
311 CEO
4
52 2 DIRECTOR 1JOHN CEO
6
73 3 SUBDIRECTOR 1MARYDIRECTOR 1 CEO
8
94 4 EMPLOYEEEMPLOYEE 1SUBDIRECTOR 1DIRECTOR 1CEO
10EMPLOYEEEMPLOYEE 2SUBDIRECTOR 1DIRECTOR 1CEO
11EMPLOYEEEMPLOYEE 3SUBDIRECTOR 1DIRECTOR 1CEO
12EMPLOYEEEMPLOYEE 4SUBDIRECTOR 1DIRECTOR 1CEO
13EMPLOYEEEMPLOYEE 5SUBDIRECTOR 1DIRECTOR 1CEO
14
155 5 MANAGER 1HELENSUBDIRECTOR 1DIRECTOR 1CEO
166 6 EMPLOYEEEMPLOYEE 6MANAGER 1SUBDIRECTOR 1DIRECTOR 1
176 6 EMPLOYEEEMPLOYEE 7MANAGER 1SUBDIRECTOR 1DIRECTOR 1
186 6 EMPLOYEEEMPLOYEE 8MANAGER 1SUBDIRECTOR 1DIRECTOR 1
196 6 EMPLOYEEEMPLOYEE 9MANAGER 1SUBDIRECTOR 1DIRECTOR 1
206 6 EMPLOYEEEMPLOYEE 10MANAGER 1SUBDIRECTOR 1DIRECTOR 1
217 7 EMPLOYEEEMPLOYEE 11MANAGER 1SUBDIRECTOR 1DIRECTOR 1
227 7 EMPLOYEEEMPLOYEE 12MANAGER 1SUBDIRECTOR 1DIRECTOR 1
238 8EMPLOYEEEMPLOYEE 13MANAGER 1SUBDIRECTOR 1DIRECTOR 1
248 8 EMPLOYEE 14MANAGER 1SUBDIRECTOR 1DIRECTOR 1
25
265 5 MANAGER 2GEORGESUBDIRECTOR 1DIRECTOR 1CEO
276 6 EMPLOYEEEMPLOYEE 15MANAGER 2SUBDIRECTOR 1DIRECTOR 1
286 6 EMPLOYEEEMPLOYEE 16MANAGER 2SUBDIRECTOR 1DIRECTOR 1
296 6 EMPLOYEEEMPLOYEE 17MANAGER 2SUBDIRECTOR 1DIRECTOR 1
306 6 EMPLOYEEEMPLOYEE 18MANAGER 2SUBDIRECTOR 1DIRECTOR 1
317 7 EMPLOYEEEMPLOYEE 19MANAGER 2SUBDIRECTOR 1DIRECTOR 1
327 7 EMPLOYEEEMPLOYEE 20MANAGER 2SUBDIRECTOR 1DIRECTOR 1
337 7 EMPLOYEEEMPLOYEE 21MANAGER 2SUBDIRECTOR 1DIRECTOR 1
34
35
363 3 SUBDIRECTOR 2NICKDIRECTOR 1 CEO
37
385 5 MANAGER 3MICHAELSUBDIRECTOR 2DIRECTOR 1CEO
396 6 EMPLOYEEEMPLOYEE 22MANAGER 3SUBDIRECTOR 2DIRECTOR 1
406 6 EMPLOYEEEMPLOYEE 23MANAGER 3SUBDIRECTOR 2DIRECTOR 1
416 6 EMPLOYEEEMPLOYEE 24MANAGER 3SUBDIRECTOR 2DIRECTOR 1
426 6 EMPLOYEEEMPLOYEE 25MANAGER 3SUBDIRECTOR 2DIRECTOR 1
437 7 EMPLOYEEEMPLOYEE 26MANAGER 3SUBDIRECTOR 2DIRECTOR 1
447 7 EMPLOYEEEMPLOYEE 27MANAGER 3SUBDIRECTOR 2DIRECTOR 1
457 7 EMPLOYEEEMPLOYEE 28MANAGER 3SUBDIRECTOR 2DIRECTOR 1
46
472 2 DIRECTOR 2JIM CEO
48
493 3 SUBDIRECTOR 3JACKDIRECTOR 2 CEO
50
515 5 MANAGER 4PETERSUBDIRECTOR 3DIRECTOR 2CEO
524 4 EMPLOYEEEMPLOYEE 1MANAGER 4SUBDIRECTOR 3DIRECTOR 2
53EMPLOYEEEMPLOYEE 2MANAGER 4SUBDIRECTOR 3DIRECTOR 2
54EMPLOYEEEMPLOYEE 3MANAGER 4SUBDIRECTOR 3DIRECTOR 2
55EMPLOYEEEMPLOYEE 4MANAGER 4SUBDIRECTOR 3DIRECTOR 2
56EMPLOYEEEMPLOYEE 5MANAGER 4SUBDIRECTOR 3DIRECTOR 2
57
582 2 DIRECTOR 3JIM CEO
59
603 3 SUBDIRECTOR 3NOONE
61
625 5 MANAGER 5PETERDIRECTOR 3 CEO
636 6 EMPLOYEEEMPLOYEE 1MANAGER 5 DIRECTOR 3
646 6 EMPLOYEEEMPLOYEE 2MANAGER 5 DIRECTOR 3
656 6 EMPLOYEEEMPLOYEE 3MANAGER 5 DIRECTOR 3
666 6 EMPLOYEEEMPLOYEE 4MANAGER 5 DIRECTOR 3
676 6 EMPLOYEEEMPLOYEE 5MANAGER 5 DIRECTOR 3

<colgroup><col><col><col span="3"><col><col><col span="3"><col><col><col span="2"><col></colgroup><tbody>
</tbody>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Why are there 2 "Subdirector 3" and the 2nd one is not responsible to anyone ????
 
Upvote 0
Mick you're right. The 2nd Subdirector 3 should be named Subdirector 4.

The "Noone" next to the title Subdirector 4 means that the position of subdirector 4 is not filled.

So, in this last group, the employees refer to Manager 5 and Director 3 (since there is no SubDir 4).

I understand it's a bit complicated. Each employee should be monitored (and appraised) by 3 managers (columns M-O in the example, where the three managers are shown as: 1st, 2nd, 3rd)
 
Upvote 0
Mick, thank you so much for your help!

However, I've been trying to make it work to my prototype, but I can't. I can run the code in your example, and it works perfectly. But I cannot do it in mine.

The error I get is "subscript out of range" when in gets to this if:
For Ac = 0 To UBound(Nams)
If Split(Dn.Value, " ")(0) = Nams(Ac) Then St = Ac + 1: Exit For
Next Ac



Also, I am not able to recognise the code you wrote so as to make any conversions if necessary. But it doesn't seem to me that any conversion should take place. Maybe I'm wrong.

I'm using excel 2003, but this should not be a problem since it works in your file, saved as excel 2003.

So, any advice on how to proceed? I mean are there any restrictions on the names in column A? Or any other restrictions?

Your code is brilliant by the way, it just doesn't work in my file.

I'm looking forward to your reply.
 
Upvote 0

Forum statistics

Threads
1,216,468
Messages
6,130,800
Members
449,595
Latest member
jhester2010

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top