Create Random Letter and Sequential Number IDs in Excel or Access
Question details
Create an identifier with a random uppercase letter followed by a six-digit sequential number, such as A000001.
- Product
- Microsoft Excel and Microsoft Access
- Device & OS
- not provided
- Scenario
- The user wants to generate identifiers in a worksheet or through a controlled Access database design.
- Observed behavior
- Each identifier should display one random uppercase letter and a number padded to six digits.
Choose whether you need worksheet-generated IDs or database records. If IDs must remain unchanged, plan to paste worksheet results as values or store the letter prefix in Access.
Generate IDs with an Excel formula
Use this method to create a numbered list with a random uppercase prefix in a worksheet.
Select the first cell for your IDs and enter =CHAR(RANDBETWEEN(65,90))&TEXT(ROWS($A$1:A1),"000000"). The first result will have a random letter followed by 000001.
Drag the cell's fill handle down the column to generate additional IDs with consecutive numbers.
Select and copy the generated cells, then use Paste Special > Values to replace the formulas with their current results.

Store a random prefix alongside an Access AutoNumber
Use this design when Access records need stable prefixes and unique numeric identifiers.
Generate Random Letter IDs in WPS Spreadsheets
Use a formula in WPS Spreadsheets to create a random uppercase prefix and a six-digit sequence, then paste the results as values to keep them stable.
- 1. Open a spreadsheet: Launch WPS Spreadsheets and open an existing workbook or create a blank one.
- 2. Enter the ID formula: Select the first cell for the IDs and enter =CHAR(RANDBETWEEN(65,90))&TEXT(ROWS($A$1:A1),"000000").
- 3. Fill the column: Drag the fill handle down to create as many numbered IDs as you need.
- 4. Keep the results stable: Copy the generated cells and use Paste Special > Values to replace the formulas with their displayed IDs.

Frequently Asked Questions
Why does the letter change when I edit my spreadsheet?
RANDBETWEEN is volatile and can generate a new letter when the sheet recalculates. Copy the ID cells and use Paste Special > Values to keep the current letters.
Does an Access AutoNumber guarantee consecutive IDs without gaps?
No. AutoNumber values are unique, but gaps can occur. Use an AutoNumber field in Table Design View when uniqueness matters more than a gap-free sequence.
How do I keep the Access letter prefix from changing?
Store the prefix in a Short Text field when the record is created, then use that field with Format([ID],"000000") in a query. Avoid generating a new random letter each time the query runs.
What happens after the number reaches 999999?
The 000000 format sets a minimum of six digits; it does not cap the number. The next number displays as 1000000, with seven digits.




