0
0
Google Sheetsspreadsheet~10 mins

Org charts in Google Sheets - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This table shows employees and their direct managers in columns A and B. The org chart will be created in column D using a formula to show the hierarchy starting from the top manager.

CellValue
A1Employee
B1Manager
A2Alice
B2Carol
A3Bob
B3Carol
A4Carol
B4David
A5David
B5
D1Org Chart
D2
D3
D4
D5
Formula Trace
=ARRAYFORMULA(IF(A2:A="", "", A2:A & IF(B2:B="", " (Top Manager)", " reports to " & B2:B)))
Step 1: A2:A
Step 2: B2:B
Step 3: IF(A2:A="", "", ...)
Step 4: IF(B2:B="", " (Top Manager)", " reports to " & B2:B)
Step 5: A2:A & IF(...)
Step 6: ARRAYFORMULA(...)
Cell Reference Map
    A       B       D
1 |Employee|Manager |Org Chart
2 | Alice  | Carol  |Alice reports to Carol
3 | Bob    | Carol  |Bob reports to Carol
4 | Carol  | David  |Carol reports to David
5 | David  |        |David (Top Manager)
Column A and B provide employee and manager data. Column D shows the org chart text created by the formula referencing columns A and B.
Result
    A       B       D
1 |Employee|Manager |Org Chart
2 | Alice  | Carol  |Alice reports to Carol
3 | Bob    | Carol  |Bob reports to Carol
4 | Carol  | David  |Carol reports to David
5 | David  |        |David (Top Manager)
The org chart in column D shows each employee with their manager or labeled as top manager if no manager is listed.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the formula show for an employee with no manager listed?
AThe employee is labeled as 'Top Manager'
BThe employee is labeled as 'No Manager'
CThe cell is left blank
DThe formula shows an error
Key Result
ARRAYFORMULA with IF concatenates employee names with their managers or labels top managers when no manager is listed.