Am running Excel 2013 on Windows 10 with 16 GB memory.
I have a hierarchical structure similar to figure 1 below. My structure is 1000+ rows and as deep as 27 levels.
For a "tree" as depicted above, how to identify the parent of a cell?
Here's what I've done so far. Using conditional formatting, and this formula:
=AND(A1<>"",OFFSET(A1,1,1)="")
I am able to identify the leaf nodes of the tree, as shown in figure 2 below.
Now I need to find the immediate ancestor (parent) of every cell (child) in the tree (with the exception of the first row that does not have a parent).
Figure 3 (below) shows an example done manually:
Further, I can associate the tree with an outline. Then I am able to count the number of decimals in the outline in order to track level changes using this formula:
=LEN(A2)-LEN(SUBSTITUTE(A2,".",""))
as shown in figure 4 below:
How to programmatically accomplish what was done manually in figure 3?
For each row (recorded in a column outside of the tree), print the location of the cell that is the parent of the cell.
Here is a similar question that manually provides "level" information.
How to find parent in an indented hierarchy?
In my case, I need to work from an outline (as shown) or by using a formula for Conditional formatting.