How to auto fill serial numbers and skip blanks in a list of cells?
If you have a list of data which contains some blank cells, now, you want to insert serial numbers for the data, but skip the blank cells as below screenshot shown. In this article, I will introduce a formula for solving this task in Excel.
Auto fill serial numbers and skip blank cells with formula
To skip the blank cells when filling serial numbers for the data, you can create a formula based on COUNTA, ISBLANK, and IF functions:
Step1: Enter the following formula into a blank cell where you want to insert the serial numbers:
=IF(ISBLANK(A2),"",COUNTA($A$2:A2))
Step2: Then, drag the fill handle down to fill this formula to other cells, and the serial numbers are filled into the cells but avoiding the blank cells, see screenshot:

Unlock Excel Magic with Kutools AI
- Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
- Custom Formulas: Generate tailored formulas to streamline your workflows.
- VBA Coding: Write and implement VBA code effortlessly.
- Formula Interpretation: Understand complex formulas with ease.
- Text Translation: Break language barriers within your spreadsheets.
Enhance your Excel capabilities with AI-powered tools. Download Now and experience efficiency like never before!
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.