ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Adding Counter to column for number of identical file numbers (https://www.excelbanter.com/excel-discussion-misc-queries/202708-adding-counter-column-number-identical-file-numbers.html)

Sam

Adding Counter to column for number of identical file numbers
 
Is there a formula or easy way to add a counter to a file? For example
if I have a file number that appears on a file 2 times and another 3
times and another 5 times I get the following results.

Column (A) Column (B)
File Number Results
9565845 1
9565845 2

9552456 1
9552456 2
9552456 3

5695695 1
5695695 2
5695695 3
5695695 4
5695695 5

Bernie Deitrick

Adding Counter to column for number of identical file numbers
 
In cell B2, enter this

=COUNTIF($A$2:A2,A2)

or, if you can have blanks and don't want those counted

=IF(A2<"",COUNTIF($A$2:A2,A2),"")

Then copy down column B to match col A.

HTH,
Bernie
MS Excel MVP


"Sam" wrote in message
...
Is there a formula or easy way to add a counter to a file? For example
if I have a file number that appears on a file 2 times and another 3
times and another 5 times I get the following results.

Column (A) Column (B)
File Number Results
9565845 1
9565845 2

9552456 1
9552456 2
9552456 3

5695695 1
5695695 2
5695695 3
5695695 4
5695695 5





All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com