Employee Lookup

Use XLOOKUP to Find Employee Details Based on Their ID

The XLOOKUP function in Excel is a powerful tool that allows you to search for a specific value in a range or array and return a corresponding value from another range or array. This function can be incredibly useful for looking up employee details based on their ID. In this article, we will walk you through an example of how to use XLOOKUP for this purpose.

Example

Here is an example table that we will use to demonstrate the XLOOKUP function. This table contains a list of employees with their IDs, Names, Departments, and Email addresses.

Employee IDNameDepartmentEmail
101John DoeHR[email protected]
102Jane SmithFinance[email protected]
103Mike JohnsonIT[email protected]
104Emily DavisMarketing[email protected]

Exercise

Use XLOOKUP to find the details of an employee based on their Employee ID.

  1. Enter the Employee ID in cell D9.
  2. Use the XLOOKUP function in cells B8, B9, and B10 to find the Name, Department, and Email, respectively.

Solution

Here is how you can set up the XLOOKUP functions:

Name Lookup

=XLOOKUP(D9, A2:A5, B2:B5, "Not Found")

This formula looks up the Employee ID entered in D9 within the range A2:A5 and returns the corresponding Name from the range B2:B5.

Department Lookup

=XLOOKUP(D9, A2:A5, C2:C5, "Not Found")

This formula looks up the Employee ID entered in D9 within the range A2:A5 and returns the corresponding Department from the range C2:C5.

Email Lookup

=XLOOKUP(D9, A2:A5, D2:D5, "Not Found")

This formula looks up the Employee ID entered in D9 within the range A2:A5 and returns the corresponding Email from the range D2:D5.

By entering an Employee ID in cell D9, the XLOOKUP function will automatically retrieve and display the Name, Department, and Email of the employee in cells H2, I2, and J2, respectively.

Explanation of the Solution

In the solution, the XLOOKUP function searches for the Employee ID in the given range. If it finds a match, it returns the corresponding value from the specified column. If no match is found, it returns "Not Found". This ensures that users get accurate and relevant details about the employee they are looking up.

Feel free to enter different Employee IDs in the embedded sheet to see how the XLOOKUP function dynamically retrieves and displays the employee details.

Please enable JavaScript in your browser to complete this form.
How would you rate this post?
Do you think adding a video explanation would be useful?
Your Excel Skill Level