Hi,
I need to build a report that can look down a list of line managers and determine the employees that sit under them whether directly or indirectly. For example, the CEO may have 5 direct reports and each of those reports have a further 20 reports.
The formula would need to return the names (or unique employee reference number which may be easier) of the 105 employees that sit under the CEO plus himself. Total would be 106 employees listed by name or employee code.
Similarly, if I picked a manager who had 3 direct reports and these 3 reports were not managers, the formula/macro would finish with these 3 names plus the manager himself. So 4 in total.
I'm restricted by company security on what I can upload online but have provided an example below.
Searching for Steve Fowler and from the RESULT column you can see that ALL employees report into Steve Fowler either directly or indirectly asides from James Windpipe & Jimmy Vialli.
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 378"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD]Employee Number[/TD]
[TD]Name[/TD]
[TD]Line Manager[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
[/TD]
[TD][TABLE="width: 126"]
<colgroup><col></colgroup><tbody>[TR]
[TD]RESULT[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
[/TD]
[/TR]
[TR]
[TD]<strike></strike>[TABLE="width: 378"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD]1[/TD]
[TD]Ryan Smith[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Jack Brown[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Tom Judge[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Harry Wilcox[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]James Windpipe[/TD]
[TD]Bobby Henderson[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Michael Rooney[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Harry Sherwood[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Brad Hislop[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Steve Fowler[/TD]
[TD]Jose Jepro[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]Rio Vidic[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]James Eastwood[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]Barry Gerrard[/TD]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]Nemanja Terry[/TD]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]Phil Smalling[/TD]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]Alan Rashford[/TD]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]Andy Irwin[/TD]
[TD]Phil Smalling[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]Jimmy Vialli [/TD]
[TD]James Windpipe[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
[/TD]
[TD][TABLE="width: 103"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Ryan Smith[/TD]
[/TR]
[TR]
[TD]Jack Brown[/TD]
[/TR]
[TR]
[TD]Tom Judge[/TD]
[/TR]
[TR]
[TD]Harry Wilcox[/TD]
[/TR]
[TR]
[TD]Michael Rooney[/TD]
[/TR]
[TR]
[TD]Harry Sherwood[/TD]
[/TR]
[TR]
[TD]Brad Hislop[/TD]
[/TR]
[TR]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]Rio Vidic[/TD]
[/TR]
[TR]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]Barry Gerrard[/TD]
[/TR]
[TR]
[TD]Nemanja Terry[/TD]
[/TR]
[TR]
[TD]Phil Smalling[/TD]
[/TR]
[TR]
[TD]Alan Rashford[/TD]
[/TR]
[TR]
[TD]Andy Irwin[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
If someone has a formula/macro for this I'd be forever grateful. Happy to assume the range starts at A1.
Thanks in advance
Ryan
I need to build a report that can look down a list of line managers and determine the employees that sit under them whether directly or indirectly. For example, the CEO may have 5 direct reports and each of those reports have a further 20 reports.
The formula would need to return the names (or unique employee reference number which may be easier) of the 105 employees that sit under the CEO plus himself. Total would be 106 employees listed by name or employee code.
Similarly, if I picked a manager who had 3 direct reports and these 3 reports were not managers, the formula/macro would finish with these 3 names plus the manager himself. So 4 in total.
I'm restricted by company security on what I can upload online but have provided an example below.
Searching for Steve Fowler and from the RESULT column you can see that ALL employees report into Steve Fowler either directly or indirectly asides from James Windpipe & Jimmy Vialli.
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 378"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD]Employee Number[/TD]
[TD]Name[/TD]
[TD]Line Manager[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
[/TD]
[TD][TABLE="width: 126"]
<colgroup><col></colgroup><tbody>[TR]
[TD]RESULT[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
[/TD]
[/TR]
[TR]
[TD]<strike></strike>[TABLE="width: 378"]
<colgroup><col span="3"></colgroup><tbody>[TR]
[TD]1[/TD]
[TD]Ryan Smith[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Jack Brown[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Tom Judge[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Harry Wilcox[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]James Windpipe[/TD]
[TD]Bobby Henderson[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Michael Rooney[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Harry Sherwood[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Brad Hislop[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Steve Fowler[/TD]
[TD]Jose Jepro[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]Rio Vidic[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]James Eastwood[/TD]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]Barry Gerrard[/TD]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD]Nemanja Terry[/TD]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]Phil Smalling[/TD]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]Alan Rashford[/TD]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]Andy Irwin[/TD]
[TD]Phil Smalling[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]Jimmy Vialli [/TD]
[TD]James Windpipe[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
[/TD]
[TD][TABLE="width: 103"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Ryan Smith[/TD]
[/TR]
[TR]
[TD]Jack Brown[/TD]
[/TR]
[TR]
[TD]Tom Judge[/TD]
[/TR]
[TR]
[TD]Harry Wilcox[/TD]
[/TR]
[TR]
[TD]Michael Rooney[/TD]
[/TR]
[TR]
[TD]Harry Sherwood[/TD]
[/TR]
[TR]
[TD]Brad Hislop[/TD]
[/TR]
[TR]
[TD]Steve Fowler[/TD]
[/TR]
[TR]
[TD]Rio Vidic[/TD]
[/TR]
[TR]
[TD]James Eastwood[/TD]
[/TR]
[TR]
[TD]Barry Gerrard[/TD]
[/TR]
[TR]
[TD]Nemanja Terry[/TD]
[/TR]
[TR]
[TD]Phil Smalling[/TD]
[/TR]
[TR]
[TD]Alan Rashford[/TD]
[/TR]
[TR]
[TD]Andy Irwin[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
[/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>
If someone has a formula/macro for this I'd be forever grateful. Happy to assume the range starts at A1.
Thanks in advance
Ryan