# How to look up a manager's name from the same employee table in Excel

Look up each manager ID in the table's own ID column: `=XLOOKUP(C2,$A$2:$A$9,$B$2:$B$9,"")`, filled down.

**Excel:** `=XLOOKUP(C2,$A$2:$A$9,$B$2:$B$9,"")` (Excel 2021, 2024 and Microsoft 365)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D |
| --- | --- | --- | --- |
| Employee ID | Name | Manager ID | Manager name |
| E-100 | Grace Kim |  |  |
| E-101 | Marcus Lee | E-100 |  |
| E-102 | Priya Nair | E-100 |  |
| E-103 | Tom Becker | E-101 |  |
| E-104 | Rosa Diaz | E-101 |  |
| E-105 | Ken Watanabe | E-102 |  |
| E-106 | Aisha Khan | E-102 |  |
| E-107 | Leo Novak | E-104 |  |

Formula in D2, filled to D9: `=XLOOKUP(C2,$A$2:$A$9,$B$2:$B$9,"")`

Result: ; Grace Kim; Grace Kim; Marcus Lee; Marcus Lee; Priya Nair; Priya Nair; Rosa Diaz

## How it works

The manager is just another employee, so the lookup searches the same table: it finds the manager ID from column C in the ID column A and returns the name from column B. Grace Kim has no manager, so the lookup finds nothing and returns the "" given as the 4th argument.

## Other ways

- `=IFNA(INDEX($B$2:$B$9,MATCH(C2,$A$2:$A$9,0)),"")`: The same lookup for Excel 2019 and earlier.

## Common mistakes

- Lock the table with `$`, but keep `C2` relative so each row looks up its own manager.
- A manager ID that isn't in the table also returns blank. Use a message like "Unknown" if you want to spot those.

## Questions

**How do I get the manager's manager?**

Nest the lookup: `=XLOOKUP(XLOOKUP(C2,$A$2:$A$9,$C$2:$C$9,""),$A$2:$A$9,$B$2:$B$9,"")`.

**How do I count each manager's direct reports?**

Count their ID in the manager column: `=COUNTIF($C$2:$C$9,A2)`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/manager-name-from-same-table
