The fastest way to number rows in Google Sheets
The quickest method is to type 1 in the first cell you want numbered, then 2 in the cell directly below it. Select both cells, then drag the small blue square at the bottom-right corner of your selection down as far as you need. Google Sheets recognizes the pattern and fills in the rest automatically.
If you have hundreds of rows, dragging takes too long. Instead, select the first two cells with your numbers, then use the fill handle by clicking and holding the blue square, but this time press Shift and click the last cell where you want the numbering to stop. Google Sheets will fill the entire range at once.
For the most control, you can also use the SEQUENCE function. Type =SEQUENCE(10) in a cell to generate numbers 1 through 10 in a column. Change the number inside the parentheses to match however many rows you need numbered.
Key Takeaways
- Type 1 and 2 in consecutive cells, select both, then drag the blue square down to auto-fill the rest of the sequence.
- For large ranges, select your first two cells, hold Shift, and click the final cell to fill the entire range without dragging.
- The SEQUENCE function generates a numbered list automatically — type =SEQUENCE(50) to create numbers 1 through 50 in one cell.
- You can combine SEQUENCE with other functions to number only rows that contain data or meet specific conditions.
Using the fill handle for small to medium lists
The fill handle method works best when you can see all the rows you want to number on your screen at once. Click the cell containing 1, hold Shift, and click the cell containing 2 to select both. A small blue square appears at the bottom-right corner of your selection — this is the fill handle.
Position your cursor directly over that blue square until it turns into a crosshair, then click and drag downward. As you drag, Google Sheets shows you a preview of the numbers it will create. Release when you reach the row where you want numbering to stop. The numbers fill in automatically based on the pattern you started.
If you accidentally drag too far or not far enough, you can undo with Ctrl+Z (or Cmd+Z on Mac) and try again. There is no penalty for multiple attempts.
The SEQUENCE function for automatic numbering
The SEQUENCE function is the most flexible approach because it creates all your numbers in one step. Click the cell where you want numbering to begin, then type =SEQUENCE(20) and press Enter. Google Sheets generates the numbers 1 through 20 vertically down from that cell.
You can modify the function to start at a different number. Type =SEQUENCE(20,1,5) to create 20 numbers starting from 5 instead of 1. The first number inside the parentheses is how many numbers to create, the second is how many columns to use (1 keeps them in a single column), and the third is what number to start with.
SEQUENCE also works horizontally. Type =SEQUENCE(1,10) to create numbers 1 through 10 across a row instead of down a column. This is useful when you want to number your columns rather than your rows.
Numbering only rows with data
If your spreadsheet has empty rows mixed in with data, you might want to number only the rows that contain information. Combine SEQUENCE with the COUNTA function to count how many non-empty cells exist in a column, then number only those rows.
In the first cell of your numbering column, type =IF(A1="","",SEQUENCE(COUNTA(A:A))) and press Enter. Replace A:A with whichever column contains your data. This formula checks each row — if the row is empty, it leaves the numbering cell blank; if the row has data, it assigns a number.
This approach requires the formula to be in the first row of your data. If your data starts in row 5, place this formula in row 5 as well. The numbering will adjust automatically if you add or delete rows later.
Numbering columns instead of rows
The same methods work for numbering columns across the top of your spreadsheet. Type 1 in the first column header cell, 2 in the next cell to the right, select both, and drag the fill handle to the right instead of down.
Alternatively, use SEQUENCE with the horizontal option: type =SEQUENCE(1,15) in your first header cell to create 15 numbers across a single row. This is faster than dragging if you have many columns.
Restarting numbering in different sections
If your spreadsheet contains multiple data sections separated by blank rows, you may want each section to have its own numbering that starts over at 1. The easiest approach is to number each section separately using the fill handle or SEQUENCE function on each group independently.
For a more automated solution, use a formula that resets the count whenever it encounters a blank row. Type =IF(A2="",1,IF(A2=A1,B1,B1+1)) in cell B2 (assuming your data is in column A). Copy this formula down your entire list. It checks whether the current row is blank or matches the previous row, and resets the numbering accordingly.
This method requires some setup and works best when your data follows a consistent pattern. Test it on a small section first to make sure it behaves the way you expect.
Removing or changing numbering
To remove numbering you no longer need, select the entire column or range containing the numbers, then press Delete. This clears the cells without affecting any other data in your spreadsheet.
If you want to change the starting number, edit the first cell in your sequence. For example, change 1 to 10, then select both the new first cell and the second cell, and drag the fill handle again. Google Sheets recalculates the pattern based on your new starting point.
With SEQUENCE formulas, simply edit the formula itself. Change =SEQUENCE(20) to =SEQUENCE(20,1,100) to start numbering from 100 instead of 1. The entire list updates instantly.
Frequently Asked Questions
Can I number rows automatically when I add new data?
Yes, if you use the SEQUENCE function. It updates automatically as your data grows. However, if you use the fill handle method, you must manually extend the numbering each time you add rows. SEQUENCE is better for spreadsheets that change frequently.
What if I want to number only visible rows after filtering?
The fill handle and SEQUENCE function both number all rows, including hidden ones. To number only visible rows after applying a filter, you must use a more complex formula involving the SUBTOTAL function, which counts only visible cells. This is an advanced technique — for most cases, numbering all rows and ignoring the hidden ones is simpler.
How do I number rows starting from zero instead of one?
Use SEQUENCE with the third parameter set to 0: type =SEQUENCE(20,1,0) to create numbers 0 through 19. Or manually type 0 and 1 in your first two cells, then use the fill handle as normal.
Can I add letters instead of numbers, like A, B, C?
The fill handle recognizes letter patterns the same way it recognizes numbers. Type A in the first cell and B in the second, then drag the fill handle down. Google Sheets continues the sequence automatically. For more than 26 items, it moves to AA, AB, AC, and so on.
What happens if I copy a sheet with numbering?
If you used the fill handle or SEQUENCE, the numbering copies exactly as it appears. If the numbering uses formulas that reference other cells, those references adjust based on where you paste. Test the copy in a new sheet to make sure the numbering still works the way you expect.