Reporting Hierarchy - Can it be done?

sscornav

Board Regular
Joined
Mar 20, 2010
Messages
117
I need to create a report of how many contractors and employees report to each of the President's direct reports. The organization has many levels, some of the people may be 5 levels down while others report directly to them. I can't use vlookup because there are many levels. I almost need a vllokup loop, but that is beyond my capabilities. I need help generating the "Group" column. Thanks!

I start with this:
Excel Workbook
ABC
1EmployeeSupervisorType
2JoeFrankEmployee
3SallySteveContractor
4MarySteveContractor
5JeffFrankEmployee
6LaurenJeffContractor
7KarenJeffEmployee
8MikeJoeContractor
9FredFrankEmployee
10RonKarenContractor
11BurtKarenContractor
12RalphKyleEmployee
13FrankPresidentEmployee
14StevePresidentEmployee
15KylePresidentEmployee
Sheet1


I want to use a macro to generate this:
Excel Workbook
ABCD
1EmployeeSupervisorTypeGroup
2JoeFrankEmployeeFrank
3SallySteveContractorSteve
4MarySteveContractorSteve
5JeffFrankEmployeeFrank
6LaurenJeffContractorFrank
7KarenJeffEmployeeFrank
8MikeJoeContractorFrank
9FredFrankEmployeeFrank
10RonKarenContractorFrank
11BurtKarenContractorFrank
12RalphKyleEmployeeKyle
13FrankPresidentEmployeeFrank
14StevePresidentEmployeeSteve
15KylePresidentEmployeeKyle
Sheet1


So I can generate this from a Pivot:
Excel Workbook
ABCD
18
19Count of EmployeeType
20GroupContractorEmployeeGrand Total
21Frank459
22Kyle22
23Steve213
24Grand Total6814
Sheet1
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Watch MrExcel Video

Forum statistics

Threads
1,133,643
Messages
5,660,051
Members
418,545
Latest member
gsingh

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
Top