Function Problems

Create Random Letter and Sequential Number IDs in Excel or Access

Phi Hung VoPhi Hung Vo Nov 20, 2026 869 views

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.
Before you start

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.

Solution 1Recommended

Generate IDs with an Excel formula

Use this method to create a numbered list with a random uppercase prefix in a worksheet.

1
Enter the formula

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.

2
Fill down

Drag the cell's fill handle down the column to generate additional IDs with consecutive numbers.

3
Freeze the IDs

Select and copy the generated cells, then use Paste Special > Values to replace the formulas with their current results.

Generate IDs with an Excel formula
Random letters can change: RANDBETWEEN recalculates, so prefixes may change until you paste the results as values. After 999999, the numeric portion will contain more than six digits.
Create IDs in WPS Spreadsheets

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. 1. Open a spreadsheet: Launch WPS Spreadsheets and open an existing workbook or create a blank one.
  2. 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. 3. Fill the column: Drag the fill handle down to create as many numbered IDs as you need.
  4. 4. Keep the results stable: Copy the generated cells and use Paste Special > Values to replace the formulas with their displayed IDs.
Generate letter-prefixed IDs with a worksheet formulaFreeze generated identifiers by pasting valuesOpen and save Microsoft Excel XLSX and XLS filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

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.