Excel Numbering (Table of Contents)
Numbering in Excel
- While we are working in Excel, we often come across to number rows in a dataset stored in Excel.
- The most common way to do this is by entering serial numbers manually.
- But what if you are having thousands of rows? And you keep adding and removing rows in between the dataset. It would be very tough, error-prone and most importantly time-consuming.
- There are numerous ways to number rows in Excel and here in this article, I will discuss some of the ways which are often used by Excel Experts while data entry.
- I am going to explain each and every way, where to use them and how they can be implemented in different scenarios with Examples. So you can understand it in a better way.
How to Add Serial Number in Excel?
To add a serial number in Excel is very simple and easy. Let’s understand the working of adding a serial number in Excel by some methods with its example.
Example #1 – Fill Handle Method
Suppose you have the following dataset. And you have to give Student ID to each entry. Student ID there will be same as a serial number of each row entry.
You can use the fill handle method here.
For example, you want to give Student ID 1056 to the first student and after it should be numerically increasing, 1056, 1057,1058 and so on…
Steps to number rows in Excel:
- Enter 1056 in cell A2 and 1057 in cell A3.
- Select both cells.
- Now you can notice a square at the bottom-right of selected cells.
- Move your cursor to this square, now it will be changed to the small plus sign.
- Now double click this plus icon and it will automatically fill series till the end of the dataset.
- It identifies a pattern from a few filled cells and quickly fills the entire selected column.
- It would only work till the last contiguous non-blank row. Viz. if you have any blank row(s) between your dataset. It will not detect them so it’s not recommended to use the fill method.
Example #2 – Fill Series Method
Suppose now we have the following dataset (same as above, now entries are only 26.).
Steps to use the Fill Series method:
- Enter 1 in cell A2.
- Go to the Home tab.
- In the Editing Group, click on the Fill drop-down.
- From the drop-down, select Series.
- In the Series dialog box, select Columns in the ” Series in ” option.
- Specify the Stop value. Here we can enter 26 and then click Ok.
- If you don’t enter any value, Fill Series will not work.
Hotkey to use fill series: ALT key+ H+ FI+ S
You can notice, it overcomes the drawback of the previous method. But then it has its own drawback that if we have blank rows in between of the dataset, Fill Series would still fill the number for that row.
4.9 (2,671 ratings)
Example #3 – COUNTA Function
Suppose you have same data set as above, now if want to number rows in excel only which are filled Viz. overcoming the shortcomings of the above 2 methods. You can use a COUNTA function here.
Steps to use a COUNTA Function:
- Now enter the formula in the cell A2 i.e. =IF(ISBLANK(B2),””,COUNTA($B$2:B2))
- Drag it down till the last row of your data set.
- In the above formula, IF function will check if cell B2 is empty or not. If found empty, it returns a blank, but if it’s not, it returns the count of all the filled cells till that cell.
Example #4 – Increment Previous Row Number
This is a very simple method. The main method is to simply add 1 to the previous row number.
Suppose you again have the same dataset.
- In the first row, manually enter 1 or any number from where you want to start numbering all rows in excel. In our case. Enter 1 in cell A2.
- Now in cell A3, simply enter the formula=A2+1.
- Drag this formula until the last row and it will be increased by 1 in each following row.
Example #5 – Row Function
We can even use a row function to give serial numbers to rows in our columns. In above all methods, serial number inserted is fixed values. But what if a row is moved or you cut and paste data somewhere else in the worksheet?
The above problem can be resolved by using the ROW function. To number the rows in a given dataset using the ROW function.
- Enter the formula in the first cell i.e. =IF(ISBLANK(B2),””,ROW()-1)
- Drag this formula until the last row.
- In the above formula IF function will check if the adjacent cell B is blank or not. If it’s found blank it will return space and if non-blank, then row function will come into the picture. ROW() function will give us the row number. Since the first row in Excel consists of our dataset. So we don’t need to count it. To eliminate the first row, I have subtracted 1 from the returned value of the above function.
- But it will not still adjust the row number, and a blank row will still have a serial number assigned to it. Though it is not shown. Look at the below screenshot.
- You can overcome the above issue with this formula i.e.=ROW()-1
- Drag this formula until the last row.
- But now it will consider the blank rows in the dataset and will number it as well. Consider below screenshot.
The main advantage of using this method is even if you delete one or more entries in your dataset. You don’t need to struggle with the numbering of rows each and every time and it will be corrected automatically in excel.
So by now, I have discussed 5 unique methods to give serial numbers to row in a dataset stored in Excel. Although there are numerous methods to do the same, above five are the most common and easy to use method which can be implemented in different scenarios.
Things to Remember about Numbering in Excel
- While storing data in Excel, we often need to give serial numbers to each row in our data set.
- Entering a serial number to each and every row in the huge dataset can be time-consuming and prone to error.
This has been a guide to Numbering in Excel. Here we discuss how to add serial Number using different methods in excel along with practical examples and downloadable excel template. You can also go through our other suggested articles –