Recursive Hierarchy Problem

echeech

New Member
Joined
Sep 15, 2009
Messages
8
I currently have two columns of ids, employee and supervisor, and need to find what division the employee rolls up to based upon the division's Vice President. I initially have the VP ID and Division in two columns on the same sheet.
If the initial supervisor is not found on the VP "table", then the code should loop to check the supervisor's supervisor until found, or leave blank if not found after 10 tries.
Here is a sample of data. The ID and Supervisor ID columns are actually over 10,000 lines long and all employees should roll up to a division.

<TABLE style="WIDTH: 329pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=438 border=0><COLGROUP><COL style="WIDTH: 39pt; mso-width-source: userset; mso-width-alt: 1901" width=52><COL style="WIDTH: 69pt; mso-width-source: userset; mso-width-alt: 3364" width=92><COL style="WIDTH: 48pt" span=3 width=64><COL style="WIDTH: 77pt; mso-width-source: userset; mso-width-alt: 3730" width=102><TBODY><TR style="HEIGHT: 13.5pt" height=18><TD class=xl63 style="BORDER-RIGHT: #608bb4 1pt solid; BORDER-TOP: #608bb4 1pt solid; BORDER-LEFT: #608bb4 1pt solid; WIDTH: 39pt; BORDER-BOTTOM: #608bb4 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: #bfd2e2" width=52 height=18>ID</TD><TD class=xl63 style="BORDER-RIGHT: #608bb4 1pt solid; BORDER-TOP: #608bb4 1pt solid; BORDER-LEFT: #608bb4; WIDTH: 69pt; BORDER-BOTTOM: #608bb4 1pt solid; BACKGROUND-COLOR: #bfd2e2" width=92>SUPERVISOR ID</TD><TD class=xl63 style="BORDER-RIGHT: #608bb4 1pt solid; BORDER-TOP: #608bb4 1pt solid; BORDER-LEFT: #608bb4; WIDTH: 48pt; BORDER-BOTTOM: #608bb4 1pt solid; BACKGROUND-COLOR: #bfd2e2" width=64>Division</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 48pt; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" width=64></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 48pt; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" width=64>VP ID</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; WIDTH: 77pt; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" width=102>Division</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc 1pt solid; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>1845</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc 1pt solid; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>2698</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">Intl</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">9312B</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">MAC</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>2698</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent">9312B</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>2698</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">Intl</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300014</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>92659</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>327884</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">HC</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300055</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>91713</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>335131</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">IT</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300063</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>402662</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>359593</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">Communications</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300095</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>94727</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>371834</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">HR/Facilities</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300154</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>305630</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>373378</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">HIE</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300171</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>325645</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>392686</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">LG</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300206</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>90468</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>396189</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">CDNS</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300207</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>302218</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>398236</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">MK/BD</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300208</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>302218</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>400403</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">FA</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300315</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>361952</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent" align=right>404129</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent">HS</TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300364</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>92272</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300370</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>92659</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300427</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>361952</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300603</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>397404</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD></TR><TR style="HEIGHT: 13.5pt" height=18><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc 1pt solid; BORDER-BOTTOM: #cccccc 1pt solid; HEIGHT: 13.5pt; BACKGROUND-COLOR: transparent" align=right height=18>300606</TD><TD class=xl64 style="BORDER-RIGHT: #cccccc 1pt solid; BORDER-TOP: #cccccc; BORDER-LEFT: #cccccc; BORDER-BOTTOM: #cccccc 1pt solid; BACKGROUND-COLOR: transparent" align=right>90818</TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD><TD style="BORDER-RIGHT: #f0f0f0; BORDER-TOP: #f0f0f0; BORDER-LEFT: #f0f0f0; BORDER-BOTTOM: #f0f0f0; BACKGROUND-COLOR: transparent"></TD></TR></TBODY></TABLE>

I believe the logical recursive pseudo-code is below, the syntax is just killing me:

Start Loop for all empl ids
Get SupvID(CurrentEmplID)
DivisionFlag = False
counter = 1

Start Loop until DivisionFlag = True OR counter = 10
Check SupvID on VP Table
If on table
put Division in 3rd column of CurrentEmplID
DivisionFlag = True
Else If counter = 10
3rd column of CurrentEmplID = "No Rollup"
Else
TempEmplID = SupvID
Get SupvID(TempEmplID)
counter = counter + 1
End Loop

Increase CurrentEmplID
End Loop for all empl ids

THANKS!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Your link finds the level an employee is within an organization. We need to be able to find the manager the employee rolls up to. Thanks for trying.
 
Upvote 0
Your link finds the level an employee is within an organization. We need to be able to find the manager the employee rolls up to. Thanks for trying.

This approach will solve any hierarchy problem. The shown solution is basically: "if this is the top level, return zero, otherwise return manager +1". You are looking for "if this is a VP, return their name, otherwise return the manager's VP name".

Cheers.
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,080
Members
453,021
Latest member
Justyna P

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