How to Create Unique Employee IDs in Excel with Formulas
Question details
The user needs to create unique employee IDs in a spreadsheet by dynamically combining initials extracted from the employee's name with numbers derived from their start date.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Managing HR or employee records and needing to auto-generate unique identification codes based on existing personnel data.
- Observed behavior
- Requires a specific combination of text and date functions to dynamically construct a unique string for each employee without manual data entry.
Ensure your spreadsheet has separate columns for the employee's full name (e.g., Column A) and their start date (e.g., Column B), and verify that the date column is formatted properly as Date values.
Use a Combined Text and Date Formula to Generate the ID
This method extracts the first and last initials from a full name and appends a formatted start date alongside a unique sequence number.
By nesting functions like LEFT, MID, FIND, and TEXT together, you can pull specific characters from strings and format numerical values into a cohesive, unique ID.
Click on the empty cell in your Employee ID column (e.g., C2) where you want the first code to appear.
Type the formula: =LEFT(A2,1)&MID(A2,FIND(" ",A2)+1,1)&YEAR(B2)-2000&TEXT(COUNTIFS($B$2:B2,">="&DATE(YEAR(B2),1,1),$B$2:B2,"<="&DATE(YEAR(B2),12,31)),"0000") and press Enter.
Hover your mouse over the bottom-right corner of cell C2 until a plus icon appears, then double-click or drag it down to apply the formula to the rest of your employee list.

Create a Simpler ID using Initials and a Formatted Start Date
If you do not require a complex unique sequence number and simply want the initials and formatted date (e.g., MMDDYY), use this streamlined approach.
Generate Employee IDs Easily with WPS Spreadsheet
WPS Spreadsheet fully supports advanced text and date formulas, making it incredibly easy to automate your HR and employee data tasks. Generate complex unique IDs in seconds with an intuitive interface.
- 1. Open your data file: Launch WPS Office Spreadsheet and open your existing employee records document.
- 2. Apply the formula: Click the cell designated for the new ID and paste the combined text and date formula into the formula bar.
- 3. Auto-fill the column: Double-click the fill handle on the bottom-right corner of the cell to instantly generate IDs for all employees.

Frequently Asked Questions
What if the employee has a middle name?
The provided formula uses FIND(" ",A2) which locates the first space. If there is a middle name, it will extract the first letter of the middle name instead of the last name. To properly handle middle names, it is best to separate the full names into distinct First Name and Last Name columns, and then reference those separate cells in your formula.
Why is the formula returning a #VALUE! error?
This usually happens if the space character cannot be found (for example, a single-word name) or if the start date column contains text instead of actual date values. Ensure all names include a space and that your dates are correctly formatted as 'Date' types in the cell properties.
Can I add a custom prefix like 'EMP-' to all employee IDs?
Yes, you can easily add a constant prefix by placing it in quotation marks at the very beginning of the formula, followed by an ampersand (&). For example: ="EMP-"&LEFT(A2,1)&MID(A2,FIND(" ",A2)+1,1)...




