19 May, 2010

How To Automatically Number Rows

You have a excel file having a long list of entries. You want the rows to automatically get numbered each time a new entry is there(because you have fade up of editing again & again).
So here is the solution:


Put this formula in the cell, which you want to be Automatically Numbered.

=IF(ISTEXT(B2),ROW()-1,"")



Let  me explain what this formula is doing:
1. The IF statement will check whether there is text in the specified cell or not; B2 here. If text will be there it will return a value, else Blank will be returned.
2. The value will be equal to "ROW()-n".
    Here ROW( ) will return the row number of the cell with text(2 in this case). Since we want to start our numbering   from    "1"   we have to subtract "1" from ROW( ) value. Here the row number of B2 was 2, hence to get 1 in this cell we subtracted 1 .
If you have started your data from B6, your formula will be

=IF(ISTEXT(B2),ROW()-5,"")

as shown here.

No comments:

Post a Comment