Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a employee details data as follows:

Name Reporting To
Emp 1 Emp 10
Emp 2 Emp 10
Emp 3 Emp 1
Emp 4 Emp 2

Now, I want to pivot the data like

Emp 10
-Emp 1
--Emp 3

-Emp 2
--Emp 4

Query 1 : Excel pivot table allows to group for two level and I am not able to achieve this requirement. Could anyone share your idea how to achieve this?

Query 2 : Also, one more report I want to display like below.
Emp Name Total Number of people Reporting to
======== ===================================
Emp 10 4
Emp 1 1
Emp 2 1
Emp 3 0
Emp 4 0

share|improve this question

migrated from Jun 1 '11 at 17:16

This question came from our site for professional and enthusiast programmers.

up vote 0 down vote accepted

I found an answer by myself. This is not possible directly with excel pivot table. So, I added one more column as Top Level Manager and had put "Emp 10" for all other employees too. When I group with the Top Level Manager first & Reporting To next, I got the count which I expected.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.