The request

From Laura Bennett, Head of Finance
Your goal
Step 1 of 3. Check the reporting lines. In G2:G61, return "no manager" if manager_id (D) is empty; otherwise look the manager_id up in the id column (A2:A61) with XLOOKUP and return that person's title (C), or "missing" if no id matches (one formula, filled down). Then J2 counts "no manager", J3 counts "missing", and J4 and J5 return the lowest and highest salary.
- Fill
G2:G61, J2:J5with the right valuesnot done yet - With formulas, not typed numbersnot done yet
- Use
IFXLOOKUPCOUNTIFnot done yet
Step 2 of 3. Summarise by department. In J8:J16, count the employees of the department in column I with COUNTIF; in K8:K16, total their salaries with SUMIF; in L8:L16, divide payroll by headcount. In J17 and K17, total the headcount and payroll columns.
- Fill
J8:L16, J17:K17with the right valuesnot done yet - With formulas, not typed numbersnot done yet
- Use
COUNTIFSUMIFnot done yet
Step 3 of 3. Count direct reports. In H2:H61, count how many rows of manager_id (D2:D61) name this row's employee_id (A) with COUNTIF. Then J19 counts the employees with more than 0 direct reports, J20 returns the widest span with MAX, and J21 and J22 return the mean and the median salary of all 60 people.
- Fill
H2:H61, J19:J22with the right valuesnot done yet - With formulas, not typed numbersnot done yet
- Use
COUNTIFMAXMEDIANnot done yet
This case unlocks when you finish any one of:
The ticket and lesson are open to read now. Solve every level in one of those chapters, in whichever track you prefer, and this case opens.
Step 1 · your sheet
| A | B | C | D | E | F | G | H | I | J | K | L | M | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | employee_id | department | title | manager_id | hire_date | salary | manager_title | direct_reports | |||||
| 2 | 1 | Executive | Chief Executive Officer | 2016-03-01 | 285,000 | No manager | |||||||
| 3 | 2 | Executive | Chief Operating Officer | 1 | 2017-01-09 | 235,000 | Manager not found | ||||||
| 4 | 3 | Sales | Head of Sales | 1 | 2018-04-16 | 172,000 | Lowest salary | ||||||
| 5 | 4 | Sales | Account Executive | 3 | 2020-01-21 | 72,000 | Highest salary | ||||||
| 6 | 5 | Sales | Account Executive | 3 | 2023-05-21 | 73,000 | |||||||
| 7 | 6 | Sales | Account Executive | 3 | 2021-02-04 | 76,000 | department | headcount | payroll | average | |||
| 8 | 7 | Sales | Account Executive | 3 | 2021-06-12 | 68,000 | Engineering | ||||||
| 9 | 8 | Sales | Account Executive | 3 | 2020-01-31 | 83,000 | Data & Analytics | ||||||
| 10 | 9 | Sales | Sales Manager | 3 | 2018-07-01 | 106,000 | Sales | ||||||
| 11 | 10 | Sales | Sales Associate | 9 | 2023-08-07 | 55,000 | Marketing | ||||||
| 12 | 11 | Sales | Sales Associate | 9 | 2018-10-02 | 51,000 | Operations | ||||||
| 13 | 12 | Marketing | Head of Marketing | 1 | 2019-02-04 | 165,000 | Customer Support | ||||||
| 14 | 13 | Marketing | Marketing Manager | 12 | 2020-01-08 | 107,000 | Executive | ||||||
| 15 | 14 | Marketing | Growth Marketer | 12 | 2019-04-25 | 87,000 | Finance | ||||||
| 16 | 15 | Marketing | Growth Marketer | 12 | 2022-08-10 | 88,000 | Merchandising | ||||||
| 17 | 16 | Marketing | Growth Marketer | 12 | 2020-04-03 | 82,000 | Total | ||||||
| 18 | 17 | Marketing | Content Strategist | 12 | 2019-04-17 | 64,000 | |||||||
| 19 | 18 | Marketing | Email Marketing Specialist | 12 | 2019-12-27 | 71,000 | Managers | ||||||
| 20 | 19 | Data & Analytics | Head of Data | 1 | 2020-08-03 | 178,000 | Widest span | ||||||
| 21 | 20 | Data & Analytics | Senior Data Analyst | 19 | 2022-03-24 | 117,000 | Mean salary | ||||||
| 22 | 21 | Data & Analytics | Data Analyst | 19 | 2025-10-31 | 91,000 | Median salary | ||||||
| 23 | 22 | Data & Analytics | Data Analyst | 19 | 2023-02-20 | 82,000 | |||||||
| 24 | 23 | Data & Analytics | Data Analyst | 19 | 2021-02-28 | 80,000 | |||||||
| 25 | 24 | Data & Analytics | Data Analyst | 19 | 2025-03-15 | 92,000 | |||||||
| 26 | 25 | Data & Analytics | Analytics Engineer | 19 | 2025-07-03 | 116,000 | |||||||
| 27 | 26 | Operations | Head of Operations | 2 | 2018-09-10 | 158,000 | |||||||
| 28 | 27 | Operations | Warehouse Manager | 26 | 2024-12-28 | 84,000 | |||||||
| 29 | 28 | Operations | Logistics Coordinator | 26 | 2022-05-28 | 59,000 | |||||||
| 30 | 29 | Operations | Logistics Coordinator | 26 | 2021-05-03 | 55,000 | |||||||
| 31 | 30 | Operations | Logistics Coordinator | 26 | 2021-03-22 | 56,000 | |||||||
| 32 | 31 | Operations | Logistics Coordinator | 26 | 2024-07-22 | 62,000 | |||||||
| 33 | 32 | Operations | Inventory Specialist | 26 | 2020-12-12 | 59,000 | |||||||
| 34 | 33 | Operations | Inventory Specialist | 26 | 2020-10-21 | 54,000 | |||||||
| 35 | 34 | Customer Support | Head of Customer Support | 2 | 2019-06-17 | 128,000 | |||||||
| 36 | 35 | Customer Support | Support Team Lead | 34 | 2021-01-03 | 72,000 | |||||||
| 37 | 36 | Customer Support | Support Specialist | 35 | 2025-10-31 | 50,000 | |||||||
| 38 | 37 | Customer Support | Support Specialist | 35 | 2023-02-02 | 43,000 | |||||||
| 39 | 38 | Customer Support | Support Specialist | 35 | 2024-09-13 | 49,000 | |||||||
| 40 | 39 | Customer Support | Support Specialist | 34 | 2024-11-20 | 44,000 | |||||||
| 41 | 40 | Customer Support | Support Specialist | 34 | 2020-04-04 | 51,000 | |||||||
| 42 | 41 | Customer Support | Support Specialist | 34 | 2024-06-19 | 47,000 | |||||||
| 43 | 42 | Customer Support | Support Specialist | 34 | 2023-05-16 | 50,000 | |||||||
| 44 | 43 | Merchandising | Head of Merchandising | 2 | 2018-01-22 | 155,000 | |||||||
| 45 | 44 | Merchandising | Buyer | 43 | 2019-11-09 | 75,000 | |||||||
| 46 | 45 | Merchandising | Buyer | 43 | 2023-09-14 | 75,000 | |||||||
| 47 | 46 | Merchandising | Buyer | 43 | 2020-01-21 | 79,000 | |||||||
| 48 | 47 | Merchandising | Merchandise Planner | 43 | 2021-06-25 | 71,000 | |||||||
| 49 | 48 | Finance | Head of Finance | 1 | 2017-11-06 | 175,000 | |||||||
| 50 | 49 | Finance | Financial Analyst | 48 | 2019-05-13 | 81,000 | |||||||
| 51 | 50 | Finance | Financial Analyst | 48 | 2024-05-03 | 76,000 | |||||||
| 52 | 51 | Finance | Accountant | 48 | 2021-01-15 | 81,000 | |||||||
| 53 | 52 | Finance | Accountant | 48 | 2021-09-30 | 76,000 | |||||||
| 54 | 53 | Engineering | Head of Engineering | 1 | 2019-03-25 | 205,000 | |||||||
| 55 | 54 | Engineering | Senior Software Engineer | 53 | 2024-04-02 | 180,000 | |||||||
| 56 | 55 | Engineering | Senior Software Engineer | 53 | 2024-03-10 | 163,000 | |||||||
| 57 | 56 | Engineering | Software Engineer | 53 | 2021-04-27 | 142,000 | |||||||
| 58 | 57 | Engineering | Software Engineer | 53 | 2023-08-21 | 130,000 | |||||||
| 59 | 58 | Engineering | Software Engineer | 53 | 2024-06-14 | 116,000 | |||||||
| 60 | 59 | Engineering | Software Engineer | 53 | 2023-04-29 | 137,000 | |||||||
| 61 | 60 | Engineering | Software Engineer | 53 | 2024-11-29 | 125,000 | |||||||
| 62 | |||||||||||||
| 63 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Each right cell becomes a firefly in your lantern.
Step 2 · your sheet
| A | B | C | D | E | F | G | H | I | J | K | L | M | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | employee_id | department | title | manager_id | hire_date | salary | manager_title | direct_reports | |||||
| 2 | 1 | Executive | Chief Executive Officer | 2016-03-01 | 285,000 | no manager | No manager | 1 | |||||
| 3 | 2 | Executive | Chief Operating Officer | 1 | 2017-01-09 | 235,000 | Chief Executive Officer | Manager not found | 0 | ||||
| 4 | 3 | Sales | Head of Sales | 1 | 2018-04-16 | 172,000 | Chief Executive Officer | Lowest salary | 43,000 | ||||
| 5 | 4 | Sales | Account Executive | 3 | 2020-01-21 | 72,000 | Head of Sales | Highest salary | 285,000 | ||||
| 6 | 5 | Sales | Account Executive | 3 | 2023-05-21 | 73,000 | Head of Sales | ||||||
| 7 | 6 | Sales | Account Executive | 3 | 2021-02-04 | 76,000 | Head of Sales | department | headcount | payroll | average | ||
| 8 | 7 | Sales | Account Executive | 3 | 2021-06-12 | 68,000 | Head of Sales | Engineering | |||||
| 9 | 8 | Sales | Account Executive | 3 | 2020-01-31 | 83,000 | Head of Sales | Data & Analytics | |||||
| 10 | 9 | Sales | Sales Manager | 3 | 2018-07-01 | 106,000 | Head of Sales | Sales | |||||
| 11 | 10 | Sales | Sales Associate | 9 | 2023-08-07 | 55,000 | Sales Manager | Marketing | |||||
| 12 | 11 | Sales | Sales Associate | 9 | 2018-10-02 | 51,000 | Sales Manager | Operations | |||||
| 13 | 12 | Marketing | Head of Marketing | 1 | 2019-02-04 | 165,000 | Chief Executive Officer | Customer Support | |||||
| 14 | 13 | Marketing | Marketing Manager | 12 | 2020-01-08 | 107,000 | Head of Marketing | Executive | |||||
| 15 | 14 | Marketing | Growth Marketer | 12 | 2019-04-25 | 87,000 | Head of Marketing | Finance | |||||
| 16 | 15 | Marketing | Growth Marketer | 12 | 2022-08-10 | 88,000 | Head of Marketing | Merchandising | |||||
| 17 | 16 | Marketing | Growth Marketer | 12 | 2020-04-03 | 82,000 | Head of Marketing | Total | |||||
| 18 | 17 | Marketing | Content Strategist | 12 | 2019-04-17 | 64,000 | Head of Marketing | ||||||
| 19 | 18 | Marketing | Email Marketing Specialist | 12 | 2019-12-27 | 71,000 | Head of Marketing | Managers | |||||
| 20 | 19 | Data & Analytics | Head of Data | 1 | 2020-08-03 | 178,000 | Chief Executive Officer | Widest span | |||||
| 21 | 20 | Data & Analytics | Senior Data Analyst | 19 | 2022-03-24 | 117,000 | Head of Data | Mean salary | |||||
| 22 | 21 | Data & Analytics | Data Analyst | 19 | 2025-10-31 | 91,000 | Head of Data | Median salary | |||||
| 23 | 22 | Data & Analytics | Data Analyst | 19 | 2023-02-20 | 82,000 | Head of Data | ||||||
| 24 | 23 | Data & Analytics | Data Analyst | 19 | 2021-02-28 | 80,000 | Head of Data | ||||||
| 25 | 24 | Data & Analytics | Data Analyst | 19 | 2025-03-15 | 92,000 | Head of Data | ||||||
| 26 | 25 | Data & Analytics | Analytics Engineer | 19 | 2025-07-03 | 116,000 | Head of Data | ||||||
| 27 | 26 | Operations | Head of Operations | 2 | 2018-09-10 | 158,000 | Chief Operating Officer | ||||||
| 28 | 27 | Operations | Warehouse Manager | 26 | 2024-12-28 | 84,000 | Head of Operations | ||||||
| 29 | 28 | Operations | Logistics Coordinator | 26 | 2022-05-28 | 59,000 | Head of Operations | ||||||
| 30 | 29 | Operations | Logistics Coordinator | 26 | 2021-05-03 | 55,000 | Head of Operations | ||||||
| 31 | 30 | Operations | Logistics Coordinator | 26 | 2021-03-22 | 56,000 | Head of Operations | ||||||
| 32 | 31 | Operations | Logistics Coordinator | 26 | 2024-07-22 | 62,000 | Head of Operations | ||||||
| 33 | 32 | Operations | Inventory Specialist | 26 | 2020-12-12 | 59,000 | Head of Operations | ||||||
| 34 | 33 | Operations | Inventory Specialist | 26 | 2020-10-21 | 54,000 | Head of Operations | ||||||
| 35 | 34 | Customer Support | Head of Customer Support | 2 | 2019-06-17 | 128,000 | Chief Operating Officer | ||||||
| 36 | 35 | Customer Support | Support Team Lead | 34 | 2021-01-03 | 72,000 | Head of Customer Support | ||||||
| 37 | 36 | Customer Support | Support Specialist | 35 | 2025-10-31 | 50,000 | Support Team Lead | ||||||
| 38 | 37 | Customer Support | Support Specialist | 35 | 2023-02-02 | 43,000 | Support Team Lead | ||||||
| 39 | 38 | Customer Support | Support Specialist | 35 | 2024-09-13 | 49,000 | Support Team Lead | ||||||
| 40 | 39 | Customer Support | Support Specialist | 34 | 2024-11-20 | 44,000 | Head of Customer Support | ||||||
| 41 | 40 | Customer Support | Support Specialist | 34 | 2020-04-04 | 51,000 | Head of Customer Support | ||||||
| 42 | 41 | Customer Support | Support Specialist | 34 | 2024-06-19 | 47,000 | Head of Customer Support | ||||||
| 43 | 42 | Customer Support | Support Specialist | 34 | 2023-05-16 | 50,000 | Head of Customer Support | ||||||
| 44 | 43 | Merchandising | Head of Merchandising | 2 | 2018-01-22 | 155,000 | Chief Operating Officer | ||||||
| 45 | 44 | Merchandising | Buyer | 43 | 2019-11-09 | 75,000 | Head of Merchandising | ||||||
| 46 | 45 | Merchandising | Buyer | 43 | 2023-09-14 | 75,000 | Head of Merchandising | ||||||
| 47 | 46 | Merchandising | Buyer | 43 | 2020-01-21 | 79,000 | Head of Merchandising | ||||||
| 48 | 47 | Merchandising | Merchandise Planner | 43 | 2021-06-25 | 71,000 | Head of Merchandising | ||||||
| 49 | 48 | Finance | Head of Finance | 1 | 2017-11-06 | 175,000 | Chief Executive Officer | ||||||
| 50 | 49 | Finance | Financial Analyst | 48 | 2019-05-13 | 81,000 | Head of Finance | ||||||
| 51 | 50 | Finance | Financial Analyst | 48 | 2024-05-03 | 76,000 | Head of Finance | ||||||
| 52 | 51 | Finance | Accountant | 48 | 2021-01-15 | 81,000 | Head of Finance | ||||||
| 53 | 52 | Finance | Accountant | 48 | 2021-09-30 | 76,000 | Head of Finance | ||||||
| 54 | 53 | Engineering | Head of Engineering | 1 | 2019-03-25 | 205,000 | Chief Executive Officer | ||||||
| 55 | 54 | Engineering | Senior Software Engineer | 53 | 2024-04-02 | 180,000 | Head of Engineering | ||||||
| 56 | 55 | Engineering | Senior Software Engineer | 53 | 2024-03-10 | 163,000 | Head of Engineering | ||||||
| 57 | 56 | Engineering | Software Engineer | 53 | 2021-04-27 | 142,000 | Head of Engineering | ||||||
| 58 | 57 | Engineering | Software Engineer | 53 | 2023-08-21 | 130,000 | Head of Engineering | ||||||
| 59 | 58 | Engineering | Software Engineer | 53 | 2024-06-14 | 116,000 | Head of Engineering | ||||||
| 60 | 59 | Engineering | Software Engineer | 53 | 2023-04-29 | 137,000 | Head of Engineering | ||||||
| 61 | 60 | Engineering | Software Engineer | 53 | 2024-11-29 | 125,000 | Head of Engineering | ||||||
| 62 | |||||||||||||
| 63 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Each right cell becomes a firefly in your lantern.
Step 3 · your sheet
| A | B | C | D | E | F | G | H | I | J | K | L | M | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | employee_id | department | title | manager_id | hire_date | salary | manager_title | direct_reports | |||||
| 2 | 1 | Executive | Chief Executive Officer | 2016-03-01 | 285,000 | no manager | No manager | 1 | |||||
| 3 | 2 | Executive | Chief Operating Officer | 1 | 2017-01-09 | 235,000 | Chief Executive Officer | Manager not found | 0 | ||||
| 4 | 3 | Sales | Head of Sales | 1 | 2018-04-16 | 172,000 | Chief Executive Officer | Lowest salary | 43,000 | ||||
| 5 | 4 | Sales | Account Executive | 3 | 2020-01-21 | 72,000 | Head of Sales | Highest salary | 285,000 | ||||
| 6 | 5 | Sales | Account Executive | 3 | 2023-05-21 | 73,000 | Head of Sales | ||||||
| 7 | 6 | Sales | Account Executive | 3 | 2021-02-04 | 76,000 | Head of Sales | department | headcount | payroll | average | ||
| 8 | 7 | Sales | Account Executive | 3 | 2021-06-12 | 68,000 | Head of Sales | Engineering | 8 | 1,198,000 | 149,750 | ||
| 9 | 8 | Sales | Account Executive | 3 | 2020-01-31 | 83,000 | Head of Sales | Data & Analytics | 7 | 756,000 | 108,000 | ||
| 10 | 9 | Sales | Sales Manager | 3 | 2018-07-01 | 106,000 | Head of Sales | Sales | 9 | 756,000 | 84,000 | ||
| 11 | 10 | Sales | Sales Associate | 9 | 2023-08-07 | 55,000 | Sales Manager | Marketing | 7 | 664,000 | 94,857 | ||
| 12 | 11 | Sales | Sales Associate | 9 | 2018-10-02 | 51,000 | Sales Manager | Operations | 8 | 587,000 | 73,375 | ||
| 13 | 12 | Marketing | Head of Marketing | 1 | 2019-02-04 | 165,000 | Chief Executive Officer | Customer Support | 9 | 534,000 | 59,333 | ||
| 14 | 13 | Marketing | Marketing Manager | 12 | 2020-01-08 | 107,000 | Head of Marketing | Executive | 2 | 520,000 | 260,000 | ||
| 15 | 14 | Marketing | Growth Marketer | 12 | 2019-04-25 | 87,000 | Head of Marketing | Finance | 5 | 489,000 | 97,800 | ||
| 16 | 15 | Marketing | Growth Marketer | 12 | 2022-08-10 | 88,000 | Head of Marketing | Merchandising | 5 | 455,000 | 91,000 | ||
| 17 | 16 | Marketing | Growth Marketer | 12 | 2020-04-03 | 82,000 | Head of Marketing | Total | 60 | 5,959,000 | |||
| 18 | 17 | Marketing | Content Strategist | 12 | 2019-04-17 | 64,000 | Head of Marketing | ||||||
| 19 | 18 | Marketing | Email Marketing Specialist | 12 | 2019-12-27 | 71,000 | Head of Marketing | Managers | |||||
| 20 | 19 | Data & Analytics | Head of Data | 1 | 2020-08-03 | 178,000 | Chief Executive Officer | Widest span | |||||
| 21 | 20 | Data & Analytics | Senior Data Analyst | 19 | 2022-03-24 | 117,000 | Head of Data | Mean salary | |||||
| 22 | 21 | Data & Analytics | Data Analyst | 19 | 2025-10-31 | 91,000 | Head of Data | Median salary | |||||
| 23 | 22 | Data & Analytics | Data Analyst | 19 | 2023-02-20 | 82,000 | Head of Data | ||||||
| 24 | 23 | Data & Analytics | Data Analyst | 19 | 2021-02-28 | 80,000 | Head of Data | ||||||
| 25 | 24 | Data & Analytics | Data Analyst | 19 | 2025-03-15 | 92,000 | Head of Data | ||||||
| 26 | 25 | Data & Analytics | Analytics Engineer | 19 | 2025-07-03 | 116,000 | Head of Data | ||||||
| 27 | 26 | Operations | Head of Operations | 2 | 2018-09-10 | 158,000 | Chief Operating Officer | ||||||
| 28 | 27 | Operations | Warehouse Manager | 26 | 2024-12-28 | 84,000 | Head of Operations | ||||||
| 29 | 28 | Operations | Logistics Coordinator | 26 | 2022-05-28 | 59,000 | Head of Operations | ||||||
| 30 | 29 | Operations | Logistics Coordinator | 26 | 2021-05-03 | 55,000 | Head of Operations | ||||||
| 31 | 30 | Operations | Logistics Coordinator | 26 | 2021-03-22 | 56,000 | Head of Operations | ||||||
| 32 | 31 | Operations | Logistics Coordinator | 26 | 2024-07-22 | 62,000 | Head of Operations | ||||||
| 33 | 32 | Operations | Inventory Specialist | 26 | 2020-12-12 | 59,000 | Head of Operations | ||||||
| 34 | 33 | Operations | Inventory Specialist | 26 | 2020-10-21 | 54,000 | Head of Operations | ||||||
| 35 | 34 | Customer Support | Head of Customer Support | 2 | 2019-06-17 | 128,000 | Chief Operating Officer | ||||||
| 36 | 35 | Customer Support | Support Team Lead | 34 | 2021-01-03 | 72,000 | Head of Customer Support | ||||||
| 37 | 36 | Customer Support | Support Specialist | 35 | 2025-10-31 | 50,000 | Support Team Lead | ||||||
| 38 | 37 | Customer Support | Support Specialist | 35 | 2023-02-02 | 43,000 | Support Team Lead | ||||||
| 39 | 38 | Customer Support | Support Specialist | 35 | 2024-09-13 | 49,000 | Support Team Lead | ||||||
| 40 | 39 | Customer Support | Support Specialist | 34 | 2024-11-20 | 44,000 | Head of Customer Support | ||||||
| 41 | 40 | Customer Support | Support Specialist | 34 | 2020-04-04 | 51,000 | Head of Customer Support | ||||||
| 42 | 41 | Customer Support | Support Specialist | 34 | 2024-06-19 | 47,000 | Head of Customer Support | ||||||
| 43 | 42 | Customer Support | Support Specialist | 34 | 2023-05-16 | 50,000 | Head of Customer Support | ||||||
| 44 | 43 | Merchandising | Head of Merchandising | 2 | 2018-01-22 | 155,000 | Chief Operating Officer | ||||||
| 45 | 44 | Merchandising | Buyer | 43 | 2019-11-09 | 75,000 | Head of Merchandising | ||||||
| 46 | 45 | Merchandising | Buyer | 43 | 2023-09-14 | 75,000 | Head of Merchandising | ||||||
| 47 | 46 | Merchandising | Buyer | 43 | 2020-01-21 | 79,000 | Head of Merchandising | ||||||
| 48 | 47 | Merchandising | Merchandise Planner | 43 | 2021-06-25 | 71,000 | Head of Merchandising | ||||||
| 49 | 48 | Finance | Head of Finance | 1 | 2017-11-06 | 175,000 | Chief Executive Officer | ||||||
| 50 | 49 | Finance | Financial Analyst | 48 | 2019-05-13 | 81,000 | Head of Finance | ||||||
| 51 | 50 | Finance | Financial Analyst | 48 | 2024-05-03 | 76,000 | Head of Finance | ||||||
| 52 | 51 | Finance | Accountant | 48 | 2021-01-15 | 81,000 | Head of Finance | ||||||
| 53 | 52 | Finance | Accountant | 48 | 2021-09-30 | 76,000 | Head of Finance | ||||||
| 54 | 53 | Engineering | Head of Engineering | 1 | 2019-03-25 | 205,000 | Chief Executive Officer | ||||||
| 55 | 54 | Engineering | Senior Software Engineer | 53 | 2024-04-02 | 180,000 | Head of Engineering | ||||||
| 56 | 55 | Engineering | Senior Software Engineer | 53 | 2024-03-10 | 163,000 | Head of Engineering | ||||||
| 57 | 56 | Engineering | Software Engineer | 53 | 2021-04-27 | 142,000 | Head of Engineering | ||||||
| 58 | 57 | Engineering | Software Engineer | 53 | 2023-08-21 | 130,000 | Head of Engineering | ||||||
| 59 | 58 | Engineering | Software Engineer | 53 | 2024-06-14 | 116,000 | Head of Engineering | ||||||
| 60 | 59 | Engineering | Software Engineer | 53 | 2023-04-29 | 137,000 | Head of Engineering | ||||||
| 61 | 60 | Engineering | Software Engineer | 53 | 2024-11-29 | 125,000 | Head of Engineering | ||||||
| 62 | |||||||||||||
| 63 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Each right cell becomes a firefly in your lantern.
What Laura gets, and why
The lesson
What the sheet holds
HR’s export has one row per employee, with names removed:
| column | holds |
|---|---|
| A | employee_id |
| B, C | department and title |
| D | manager_id: the employee_id of their manager, empty for the CEO |
| E, F | hire date and yearly salary |
Removing names is a good habit for any people data that leaves HR. It does not make the sheet anonymous, though: the only Executive earning 285,000 is obviously the CEO.
Step 1: do the reporting lines hold together?
Every manager_id should be another row’s employee_id. XLOOKUP finds it and returns that person’s title; its fourth argument decides what to show when nothing matches:
G2 =IF(D2="","no manager",XLOOKUP(D2,$A$2:$A$61,$C$2:$C$61,"missing"))
The IF in front handles the CEO, whose manager cell is empty. Then two counts and a range check:
J2 =COUNTIF(G2:G61,"no manager")
J3 =COUNTIF(G2:G61,"missing")
J4 =MIN(F2:F61)
J5 =MAX(F2:F61)
One “no manager” and no “missing” means the org chart is complete. A monthly salary typed into a yearly column would show up in J4 as a number near 4,000.
Step 2: headcount and payroll by department
COUNTIF counts the rows whose department matches the label; SUMIF adds their salaries:
J8 =COUNTIF($B$2:$B$61,I8)
K8 =SUMIF($B$2:$B$61,I8,$F$2:$F$61)
L8 =K8/J8
Fill them down to row 16 and total in row 17. If the totals do not come to 60 people and the sum of column F, a department label is misspelled or missing.
Step 3: span of control, mean and median
Span of control is the number of people who report directly to someone. Turn the question around: an employee’s direct reports are the rows whose manager_id is their id.
H2 =COUNTIF($D$2:$D$61,A2)
Most rows show 0. The twelve that do not are the managers, and MAX gives the widest span, 7.
Then the pay summary. The mean of all 60 salaries is 99,317, the median 81,000. The gap comes from a few senior salaries: the CEO, the COO and the department heads. For “what does a typical person earn”, the median is the honest number.
Pitfalls
- XLOOKUP without a fallback shows
#N/A, which no COUNTIF of a word will catch. - Unlocked ranges slide when you fill down; lock every data range with $.
- The average of a two-person group gives away both salaries to anyone who knows one. Keep small groups out of any report that goes beyond Finance and HR.
Lantern lit!
Practised: data validationxlookupcountifsumifmedianspan of control
- Solved
- No hints
- First run
