Function Problems

How to Generate Sequential Receipt Numbers in Excel

Camila MilosovichCamila Milosovich Nov 2, 2026 870 views

Question details

The user needs to automatically generate sequential numbers for receipts or raffles as new data records are entered into a worksheet.

How to Automatically Generate Sequential Receipt Numbers in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Creating a tracking sheet for receipts, invoices, or raffle tickets where a new sequential ID must appear automatically when a corresponding data cell is populated.
Observed behavior
The worksheet must begin numbering with a specific starting value and automatically generate subsequent numbers only when corresponding data cells in adjacent columns are filled.
Before you start

Determine the starting number for your receipts or raffle tickets and identify which column will trigger the automatic numbering when data is entered.

Solution 1Recommended

Use the SEQUENCE Function for Automatic Numbering

This method uses a dynamic array formula to automatically populate sequential numbers as new records are added to adjacent columns, saving time on manual data entry.

The SEQUENCE function combined with COUNTA creates a dynamic array that expands automatically as you add new items to your tracker.

1
Enter the starting number

Type your initial receipt or raffle number in the first cell of your numbering column, for example, cell A2.

2
Input the dynamic formula

In the cell directly below it (A3), enter the following formula: =SEQUENCE(COUNTA(B2:B1000),1,A2+1). Do not manually drag or fill this formula down.

3
Add new data to trigger numbering

Begin entering your data in column B, starting from cell B2. As you populate each cell in column B, the next sequential number will automatically appear in column A.

Use the SEQUENCE Function for Automatic Numbering
Adjusting the Data Range: The formula uses B2:B1000 as an estimated range. If you expect to have more than 1000 records, increase this number accordingly (e.g., change it to B5000).
Easy Spreadsheet Data Management

Generate Sequential Numbers Easily with WPS Spreadsheet

You can seamlessly manage receipt numbering, generate dynamic sequence arrays, and track business data using WPS Spreadsheet, a highly compatible and free office suite.

  1. 1. Create a new workbook: Open WPS Spreadsheet and create a new blank workbook for your receipt tracker.
  2. 2. Set the starting number: Type your starting receipt number in cell A2.
  3. 3. Apply the auto-numbering formula: Enter the formula =SEQUENCE(COUNTA(B2:B1000),1,A2+1) in cell A3 to auto-generate sequence numbers as you fill out column B.
Fully compatible with Microsoft Excel functions like SEQUENCE and COUNTAFree, lightweight, and fast spreadsheet processingRich library of built-in templates for invoices and receipts
microsoft office alternative - wps office

Frequently Asked Questions

Can I add a prefix like 'INV-' to my sequential receipt numbers?

Yes, you can use custom cell formatting to add a prefix without changing the actual numerical value. Select your numbering column, press Ctrl+1 to open Format Cells, go to Custom, and enter "INV-"0 as the type. The SEQUENCE formula will still work normally.

Why does the SEQUENCE function result in a #NAME? error?

The #NAME? error typically occurs if you are using an older version of Excel that does not support dynamic array functions. The SEQUENCE function is only available in Microsoft 365, Excel 2021, and newer versions, or modern alternatives like WPS Office.

How do I make the numbering stop or pause if there is a blank row in the data?

If you want numbering to depend on the exact adjacent cell rather than a total count of the range, you can use a traditional IF formula instead of SEQUENCE. In cell A2, type =IF(B2<>"", 1, ""), and in A3, type =IF(B3<>"", MAX($A$2:A2)+1, ""). Drag this formula down your column.