Auto generate serial number in Excel: VBA, formula

Auto generate serial number in Excel: VBA, formula

Microsoft's office software Excel is a powerful tool to perform day-to-day activities with, like simple arithmetic, sorting, filtering, arranging and summarising data in various formats. Excel has a huge collection of formulas which can be used independently or in conjunction with each other to achieve desired results. This article will show you how to create serial numbers.

How to create serial numbers in Excel?

Logical formulas can be combined with text or numeric functions to segregate data in any desired way, such as excluding rows that do not have serial numbers. The same formula can be applied to multiple cells by simply dragging it to them or by using paste-special with formulas and number formats.

Assumptions:

  • 1. You want series to appear in Column A
  • 2. If a row has a data, then column B of that row would have data
  • 3. Row 1 is a header

Write in Cell A2

=IF($B2="","",COUNTA($B$2:$B2)) 

Drag this formula down

any more excel questions? check out our forum!
Around the same subject

Excel