Autofill Sequential Codes in Excel Such as 100-01 and 100-02
Question details
Create a continuous list of codes with a fixed prefix, a hyphen, and a two-digit sequential number.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to generate codes such as 100-01, 100-02, and 100-03 by filling a formula down a worksheet column.
- Observed behavior
- The required result is a sequence that keeps the 100 prefix and formats each increasing suffix with two digits.
Choose the first cell where the code list should begin, such as A1. Ensure the cells below it are available for the generated codes and are not part of a filtered range that could affect filling.
Use a fixed prefix formula and fill it down
Use this method when every code should use the same prefix, such as 100, with a two-digit number that increases by one in each row.
The ROWS function counts the rows in the expanding range, while TEXT formats the count as two digits. Filling the formula down creates a continuous code series.
Click cell A1, or the first cell of your code list, and enter ="100-"&TEXT(ROWS($A$1:A1),"00"). Press Enter.
Select the cell containing the formula, then drag the small square at the lower-right corner of the cell down through the rows where you need codes.
Verify that the first results display as 100-01, 100-02, 100-03, and continue in order as you fill down.

Reference a prefix stored in another cell
Use this method when the prefix may change and you want to update all generated codes by editing one cell.
Generate Numbered Codes Easily in WPS Spreadsheets
WPS Spreadsheets lets you combine fixed text, row counts, and number formatting to create code lists such as 100-01 and fill them down in seconds. Its familiar spreadsheet layout makes formula entry and autofill straightforward for Excel users.
- 1. Open a spreadsheet in WPS Spreadsheets: Launch WPS Office, select Spreadsheets, and open an existing workbook or choose New to create a blank sheet.
- 2. Select the first output cell: Click the first cell for the code series, such as A1.
- 3. Enter the sequential code formula: Type ="100-"&TEXT(ROWS($A$1:A1),"00") in the formula bar or directly in the cell, then press Enter.
- 4. Fill the formula through the target rows: Select the formula cell and drag the fill handle at its lower-right corner downward to generate the remaining codes.

Frequently Asked Questions
Why does my sequence show 100-1 instead of 100-01?
Wrap the sequential number in the TEXT function with the format "00", for example: ="100-"&TEXT(ROWS($A$1:A1),"00"). The "00" format adds a leading zero for values below 10.
How can I start the code sequence at 100-10?
Add 9 to the row count in the formula: ="100-"&TEXT(ROWS($A$1:A1)+9,"00"). The first result will be 100-10.
Can I change the prefix without editing every formula?
Yes. Put the prefix in a cell such as B1 and use =$B$1&"-"&TEXT(ROWS($A$1:A1),"00"). Changing B1 updates every generated code.
How do I convert generated codes from formulas to fixed values?
Select the formula cells, copy them, then use Paste Special > Values from the Home tab or right-click menu. This replaces formulas with the currently displayed codes.




