Function Problems

Autofill Sequential Codes in Excel Such as 100-01 and 100-02

John WilsonJohn Wilson Nov 12, 2026 869 views

Question details

Create a continuous list of codes with a fixed prefix, a hyphen, and a two-digit sequential number.

Autofill Sequential Codes in Excel Such as 100-01 and 100-02
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter the formula in the first code cell

Click cell A1, or the first cell of your code list, and enter ="100-"&TEXT(ROWS($A$1:A1),"00"). Press Enter.

2
Use the fill handle

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.

3
Check the generated sequence

Verify that the first results display as 100-01, 100-02, 100-03, and continue in order as you fill down.

Use a fixed prefix formula and fill it down
Expected result: The formula preserves the 100 prefix and automatically adds a leading zero to suffixes from 01 through 09.
Create sequential spreadsheet codes

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. 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. 2. Select the first output cell: Click the first cell for the code series, such as A1.
  3. 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. 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.
Create sequential codes with TEXT, ROWS, and the fill handle.Keep prefixes in a separate cell for easy code-series updates.Open, edit, and save Microsoft Excel XLSX and XLS files.Use a familiar spreadsheet interface for a seamless Excel-style workflow.
microsoft office alternative - wps office

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.