View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic Domenic is offline
external usenet poster
 
Posts: 150
Default finding multiple parent-child relationships?

Not quite sure whether you want to count or flag 'front line' managers.
So, assuming that...

1) you want to count

2) A2:A10 contains the employee name

3) B2:B10 contains the corresponding manager

4) D2 contains the manager of interest

Try the following formula, which needs to be confirmed with
CONTROL+SHIFT+ENTER, not just ENTER...

=SUM(IF(ISNUMBER(MATCH(IF($B$2:$B$10=D2,$A$2:$A$10 ),$B$2:$B$10,0)),1))

Hope this helps!

In article ,
"Keith R" wrote:

I have a list of a bunch of people (employees) (column A) and in another
column (B), their managers. Each employee has a single record, but a manager
name can show up multiple times. Not all employees are managers.

I need to identify which managers are "front line" managers, e.g. who do not
have any other managers reporting to them. I'd like to avoid going to VBA if
this is possible to do in a formula.

Basically, my logic needs to be: For every manager, check their direct
reports to see if they also show up in the manager column. If none do, then
flag this individual as a front line manager

The problem I'm having is figuring out how to get a formula to process
/every/ direct report. I'll need to use sumproduct or an array formula, but
I'm still getting stuck on the logic. Let's say I copy column A to column C,
just so I can do vlookups on either group.

=sumproduct ((A1:A1000=ThisManager)*(vlookup(B1:B1000,B1:C1000 ,2,False)....
but even here, I don't think the vlookup will necessarily be on the same row
as the first parts of my sumproduct?

Any ideas to get me started?

Thanks!
Keith