Solved

Org Hierarchy Help

Posted on 2014-09-21
19
175 Views
Last Modified: 2014-09-25
I have a hierarchy rollup which deplays management bottom up and top down.

The top down managers are in columns of levels
Level 1 CEO
Level 2 CEO direct reports
continuing to Level 10

I need someone to look at what I've done to see if they can make this process simplier

An I need for the managers in Column T to show their level in Column U


EXAMPLE
Column T                      Columnn U                      
CEO 1                             LVL 1      (U3) from AG      
Manager 13                   LVL 6      (U101) from AL      
Manager 521                 LVL 10    (U7973) from AP
Manager (EXEC) 160     LVL 4      (U5350) from AJ
ROLL-UP--example-.xlsx
0
Comment
Question by:ablove3
  • 10
  • 9
19 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 40337376
Do you need to retain those lookups or are you only concerned with the LVL # values in column U?
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40337451
I put the following formula in U4 and did a fill down operation to populate the cells below.
="LVL "&11-COUNTBLANK(D4:M4)

Open in new window

0
 

Author Comment

by:ablove3
ID: 40337725
I need to obtain the lookups because the data will be refreshed 2 twice a week.

I like your formula and I see what it does, but I need it to identify the level for the employee in column T.

The CEO 1 is the only "LVL 1" (view the filter for column AG)

President 5 is a LVL 2 (view the filter for column  AH)
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40337795
Did you incorporate the formula as I instructed you to do?
0
 

Author Comment

by:ablove3
ID: 40338094
Yes, I followed your instructions and here are the results (attached).

What I'm looking for is a form of lookup on the cells in column to in the range of AG:AP that will return a column header from AG$2:AP$2 for the values in column T.  It looks like your formula is returning the column header for the values in U
0
 

Author Comment

by:ablove3
ID: 40338108
sorry upload didn't complete
Copy-of-ROLL-UP--example-.xlsx
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40338270
I'm filling in the LVL # values.  That is what you stated in your question.
0
 

Author Comment

by:ablove3
ID: 40338688
Yes, you are, but you're not bringing in the value for the right cells.  I don't think you read my question in great detail. I gave you the values that I expect to see in three different cells.  If a name in column T doesn't appear in the names between AE:AN, it shouldn't receive a level.  Thank you for your effort, but I'll leave the question open for a little while.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40338897
AE:AN
did you mean AG:AP?
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

Author Comment

by:ablove3
ID: 40339062
Yes, I've been working with so many spreadsheets,, I'm getting them all confused lol!
0
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 40339560
This function does the lookup.  However, you will need to use an XLSM or XLSB format for your workbook.
Public Function GetColHdrForMatch(parmFind As String, parmRange As Range) As String
    Static dicRanges As Object
    Static dicRng As Object
    Static rng As Range
    
    If dicRanges Is Nothing Then
        Set dicRanges = CreateObject("scripting.dictionary")
    End If
    If dicRanges.exists(parmRange.Address) Then
    Else
        Set dicRng = CreateObject("scripting.dictionary")
        For Each rng In parmRange.Cells
            If Len(rng.Value) <> 0 Then
                If dicRng.exists(CStr(rng.Value)) Then
                Else
                    dicRng(CStr(rng.Value)) = rng.Column
                End If
            End If
        Next
        dicRanges.Add CStr(parmRange.Address), dicRng
    End If
    Set dicRng = dicRanges(CStr(parmRange.Address))
    If dicRng.exists(parmFind) Then
        GetColHdrForMatch = parmRange.Worksheet.Cells(parmRange.Row, dicRng(parmFind))
    Else
        GetColHdrForMatch = vbNullString
    End If
End Function

Open in new window


To use this in your worksheet, place the following formula in U3 and do a fill-down operation.
=GetColHdrForMatch(T3,$AG$2:$AP$23852)

Open in new window

0
 

Author Comment

by:ablove3
ID: 40340686
aikimark, I'm not sure what I'm doing wrong.  I added the code and saved the file as xlsm. When I put the formula in column U3, I get the error message "#Name?"

What am I doing wrong?

I didn't realize you were a coder.  If you have time could you see if there's a way to streamline the hierarchy bottom up (W:AF) and Top down (AG:AP).  Those formulas are killing my excel space.  Everytime I save it takes 20 minutes for the worksheet to save.  I lose 2 hours of time a day, just waiting several times for the form to save.  I also have to do 3 of these for different scenarios.  I desperately need a time saver.
ROLL-UP--example-2.xlsm
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40340699
Where did you put the routine?  It ought to go into a module, which you will need to insert.
0
 

Author Comment

by:ablove3
ID: 40340728
hum, that's strange, when I opened the file back up, it seems to work now.  That's awesome. Thank you.
0
 

Author Closing Comment

by:ablove3
ID: 40340730
I received an excellent solution that all help me save a lot of time at work.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40342411
I suggest starting with this BOM hierarchical rollup Access article
http:A_19-BOM-parts-list-expansion.html

and this tree/hierarchy article
http:A_2153-Managing-Trees-and-Hierachies-in-Access.html
0
 

Author Comment

by:ablove3
ID: 40342452
ok, I'll try them
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40342472
You can disable automatic calculation as well as calculation before saving.  These are both options under your control.
0
 

Author Comment

by:ablove3
ID: 40343876
Great idea.  Thank you
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now