Excel - Create serial numbers

April 2017

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, like creating serial numbers. Logical formulas can be combined with text or numeric functions to segregate data in any desired way, for example, to exclude rows which 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.


Issue


I have an Excel spreadsheet with information I want to catalogue. I would like to create a serial number for each entry. Certain rows are blank, however, and the function would need to ignore the blank rows.

Solution


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

Note


Thanks to rizvisa1 for this tip on the forum.

Related


Published by aakai1056. Latest update on February 14, 2012 at 11:58 AM by Paul Berentzen.
This document, titled "Excel - Create serial numbers," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).