ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Projects
  3. Build an Employee Lookup Sheet in Excel

Build an Employee Lookup Sheet in Excel

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

An employee lookup sheet has a staff table and a small lookup card. You type an employee ID into one cell, and XLOOKUP formulas fill in that person's name, department and other details from the table. Add "Not found" as XLOOKUP's fourth argument so a wrong ID shows a clear message instead of #N/A.

Key takeaways

  • Keep one staff table with a unique ID in the first column, and build the lookup card next to it.
  • Each card field is one XLOOKUP: the ID cell, the ID column, and the column to bring back.
  • Lock the ID cell and the table ranges with $ so the card formulas can be copied.
  • Use the fourth argument, such as "Not found", for IDs that don't exist.
  • In Excel 2019 or older, use VLOOKUP with FALSE inside IFERROR instead.
On this page+
  1. What you're building
  2. Step 1: Build the lookup card with XLOOKUP
  3. Step 2: Handle IDs that don't exist
  4. Step 3: Make the ID a drop-down list
  5. Step 4: Add search by name and by department
  6. Version note: building it in older Excel
  7. How to extend the employee lookup sheet
  8. Practise it

An employee lookup sheet in Excel lets anyone type an employee ID and instantly see that person's name, department, location and phone extension. You build it with one staff table and a small "lookup card" of XLOOKUP formulas, plus a friendly "Not found" message for wrong IDs. This project is useful practice for HR and admin roles, and it covers the lookup skills most Excel tests check.

What you're building#

The finished sheet has two parts side by side: the staff table (the data) and the lookup card (the formulas). You only ever type in one cell of the card, the ID.

Here is the staff table:

ABCDE
1IDNameDepartmentLocationExtension
2E-101Priya ShahFinanceLondon2104
3E-102Tom BeckerSalesLeeds2231
4E-103Aisha KhanOperationsLondon2318
5E-104Mateo SilvaSalesBristol2240
6E-105Lena OrtizFinanceLeeds2107
7E-106Ken WatanabeITLondon2402

Two rules keep the lookup reliable. Every ID must be unique, and the table should have no blank rows or merged cells.

Step 1: Build the lookup card with XLOOKUP#

Each field on the card is one XLOOKUP that searches the ID column and brings back a different column. XLOOKUP's shape is =XLOOKUP(what to find, where to look, what to bring back, [if not found]).

Put the labels in column G and the formulas in column H:

CellLabelFormulaResult for E-104
H1Employee IDE-104 (typed)
H2Name=XLOOKUP($H$1,$A$2:$A$7,$B$2:$B$7,"Not found")Mateo Silva
H3Department=XLOOKUP($H$1,$A$2:$A$7,$C$2:$C$7,"Not found")Sales
H4Location=XLOOKUP($H$1,$A$2:$A$7,$D$2:$D$7,"Not found")Bristol
H5Extension=XLOOKUP($H$1,$A$2:$A$7,$E$2:$E$7,"Not found")2240

The $ signs lock the ID cell and the table, so you can copy H2 down and only change the return column. Press F4 on Windows or ⌘T on a Mac to add them. The XLOOKUP function guide explains every argument, and XLOOKUP in Excel for beginners has more examples.

Get the whole card from one formula#

XLOOKUP can return several columns at once. =XLOOKUP(H1,A2:A7,B2:E7) spills (fills) the name, department, location and extension across one row. To show them down a column like a card, wrap it in TRANSPOSE:

Excel formula
=TRANSPOSE(XLOOKUP(H1,A2:A7,B2:E7))

Leave the cells below empty, or Excel shows #SPILL!. The one-formula version is neat, but separate formulas are easier for colleagues to read and edit.

Step 2: Handle IDs that don't exist#

When an ID isn't in the table, XLOOKUP returns #N/A unless you give it a fourth argument. With "Not found" in place, typing E-199 shows Not found in every field.

If a real ID still shows Not found, the data is usually the problem:

  • Extra spaces: "E-104 " with a trailing space is a different value. Clean it with TRIM; see clean messy data with TRIM, CLEAN and PROPER.
  • Numbers vs text: if IDs are plain numbers, one list may hold them as text. See numbers stored as text.
  • Wrong range: the ID column must cover every row of the table.

Our guide to fixing #N/A errors in lookups goes through each cause.

Step 3: Make the ID a drop-down list#

A drop-down list stops typos, because people pick an ID instead of typing it.

  1. Select H1.
  2. Go to Data > Data Validation (Windows shortcut: Alt, A, V, V). On a Mac, use Data > Data Validation.
  3. Under Allow, choose List.
  4. In Source, type =$A$2:$A$7, then click OK.

Create a drop-down list in Excel covers lists that grow as you add staff.

Step 4: Add search by name and by department#

The same table answers other questions with small changes.

Find an ID from a name. The ID column is to the left of the names, which VLOOKUP can't do but XLOOKUP can. With Lena Ortiz in H8:

Excel formula
=XLOOKUP(H8,B2:B7,A2:A7)

The result is E-105. More ways to do this are in how to look up to the left.

Search by part of a name. Match mode 2 allows wildcards. With Khan in H15, this returns E-103:

Excel formula
=XLOOKUP("*"&H15&"*",B2:B7,A2:A7,"Not found",2)

List everyone in a department. XLOOKUP stops at the first match, so use FILTER to get them all. With Sales in H11:

Excel formula
=FILTER(B2:B7,C2:C7=H11)
=COUNTIFS(C2:C7,H11)

FILTER spills Tom Becker and Mateo Silva, and COUNTIFS returns 2. Our comparison of XLOOKUP vs FILTER explains when to use each.

Version note: building it in older Excel#

XLOOKUP and FILTER need Excel 2021, Excel 2024, Microsoft 365 or Excel for the web. In Excel 2019 or older, use VLOOKUP with an exact match inside IFERROR:

Excel formula
=IFERROR(VLOOKUP($H$1,$A$2:$E$7,2,FALSE),"Not found")

Change the column number (2) for each field: 3 for Department, 4 for Location, 5 for Extension. VLOOKUP can't look left, so "find the ID from a name" needs INDEX and MATCH there. VLOOKUP vs XLOOKUP compares the two in detail.

How to extend the employee lookup sheet#

Once the card works, a few additions make it a real tool:

  1. Put the table on its own sheet and the card on a "Lookup" sheet. Reference it like Staff!$A$2:$A$7; see reference another sheet.
  2. Turn the staff list into a table (Ctrl+T on Windows, or Insert > Table) so new hires are included automatically.
  3. Protect the formulas so only H1 can be edited: protect a sheet and lock cells.
  4. Add start dates and calculate years of service with DATEDIF.
  5. Add a schedule or price list next: the weekly shift schedule project and the price list with discounts and tax use the same "table plus formulas" pattern.

This exact task, finding a person's details by ID and counting a department, appears often in hiring tests. See how to pass an Excel test for a job interview, the Excel interview questions you can practise, and the Excel skills every data analyst needs.

Practise it#

Fill in the Department field in the exercise on this page. Then work through the XLOOKUP lesson, and try the HR roster interview drill, which asks you to look up a salary, count a department and list its staff without being told which functions to use.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

The lookup card shows details for the ID in H1. In H3, use XLOOKUP to return that employee's Department (C2:C7). Show "Not found" if the ID doesn't exist.

fx
ABCDEFGHI
1
ID
Name
Department
Location
Extension
Employee ID
E-104
2
E-101
Priya Shah
Finance
London
2104
3
E-102
Tom Becker
Sales
Leeds
2231
Department
4
E-103
Aisha Khan
Operations
London
2318
5
E-104
Mateo Silva
Sales
Bristol
2240
6
E-105
Lena Ortiz
Finance
Leeds
2107
7
E-106
Ken Watanabe
IT
London
2402
8
9
10

Tip: Find H1, in the ID column A2:A7, bring back the Department column C2:C7, and add "Not found" as the fourth part. The result is Sales.

Practise this in a lesson

LessonXLOOKUPLook up in any direction with XLOOKUP and show a friendly message when nothing matches.LessonInterview drill: HR rosterWork through a timed-test style HR roster: look up a salary, count, total and list by department, flag bonuses, calculate tenure and handle a missing ID.Function guideXLOOKUPXLOOKUP explained with real examples: exact matches, looking left and custom not-found messages, plus a live exercise to try now.

Frequently asked questions

How do I look up an employee by ID in Excel?

+

Use XLOOKUP: =XLOOKUP(H1,A2:A7,B2:B7) finds the ID in H1 in the ID column A2:A7 and returns the name from B2:B7. In older Excel, use =VLOOKUP(H1,A2:E7,2,FALSE).

Why does my employee lookup return #N/A?

+

#N/A means the ID wasn't found. Check for typos, extra spaces, and IDs stored as numbers in one place and text in another. Add a fourth argument such as "Not found" to show a message instead.

Can I look up an employee by name instead of ID?

+

Yes. Point XLOOKUP at the name column: =XLOOKUP(H8,B2:B7,A2:A7) returns the ID for the name in H8. Names are less reliable than IDs, because two people can share a name and the first match wins.

How do I list everyone in one department?

+

Use FILTER, which returns every match: =FILTER(B2:B7,C2:C7=H11). XLOOKUP returns only the first match, so it suits single-person lookups.

Can I make the ID a drop-down list?

+

Yes. Select the ID input cell, go to Data > Data Validation, choose List, and set the source to the ID column, such as =$A$2:$A$7.

Sources

  • XLOOKUP function - Microsoft Support
  • VLOOKUP function - Microsoft Support
  • FILTER function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What you're building
  2. Step 1: Build the lookup card with XLOOKUP
  3. Step 2: Handle IDs that don't exist
  4. Step 3: Make the ID a drop-down list
  5. Step 4: Add search by name and by department
  6. Version note: building it in older Excel
  7. How to extend the employee lookup sheet
  8. Practise it

Keep reading

Projects· 6 min read

Make a Weekly Shift Schedule in Excel

A weekly shift schedule in Excel is a grid with one row per person and one column per day, filled with short shift codes such as E (early), L (late) and OFF. Type the week's start date once and build the other dates with +1. COUNTIF totals each person's shifts, and COUNTIFS checks that every day has enough people and a supervisor.

Projects· 6 min read

Price List With Discounts and Tax in Excel

A price list in Excel needs three formulas per product. Sale price is =ROUND(B2*(1-C2),2), the list price less its discount. Tax is =ROUND(D2*$I$1,2), with the tax rate in one cell locked with $. Final price is sale price plus tax. Keep the rates in their own cells so one change updates every row.

Tests & careers· 7 min read

How to Pass an Excel Test for a Job Interview

To pass an Excel test for a job interview, practise the tasks tests commonly set: totals, IF, COUNTIF and SUMIF, VLOOKUP or XLOOKUP, absolute references, sorting, filtering and a simple pivot table. Build every answer from cell references so it updates when inputs change, check results against the data, and do at least one timed practice test first.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free