Dumb Question

wazzulu1

Board Regular
Joined
Oct 4, 2006
Messages
164
Hi;

What is the best way to insert a count of the file number in the 3rd column (VBA or Formula)?

I have 22,000 records that I need to group, and figured that if I can count each file number, and place the number in the 3rd column, it would work, just not sure how to do it:confused: (Example below)
File NumberTheDateTheCount
81143447/30/2018
81143444/17/2018
81143447/10/2018
81403976/27/2016
870205410/27/2016
870205412/27/2016
87020545/26/2017
87020542/14/2017
87020541/27/2017
87020543/28/2017
89511283/25/2018
89391871/18/2016
35651941/11/2016
35294279/11/2017
35106359/18/2017
35048853/7/2016
35048852/29/2016
383508711/1/2016
38350872/27/2017
383508710/13/2017
38350874/4/2018
38350874/12/2017
38350876/26/2017
38300179/18/2017
38251269/1/2016
332447911/2/2015
33021255/23/2016
36146662/9/2016
36710191/22/2016
36710192/8/2016
32977008/22/2016

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>

<tbody>
</tbody>
 
Thank You, This works!!!!!!

I have 22,000 records to tag with this, do I have to drag this down manually, or can I use a copy & paste short cut?
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Here is an alternate VBA solution

Code:
Option Explicit


Sub CountFileNr()
    Dim lr As Long
    Dim i As Long
    lr = Range("A" & Rows.Count).End(xlUp).Row
    Range("C2") = 1
    For i = 3 To lr
        If Range("A" & i) = Range("A" & i - 1) Then
            Range("C" & i) = Range("C" & i - 1) + 1
        Else: Range("C" & i) = 1
        End If
    Next i
End Sub
 
Upvote 0
Thank You, This works!!!!!!

I have 22,000 records to tag with this, do I have to drag this down manually, or can I use a copy & paste short cut?

As long as you have data in every row of col B, enter the formula in C2 Then put the cursor on the bottom right hand corner of the cell & double click
 
Upvote 0
This forum is so valuable, I appreciate everyone's willingness to help others with the knowledge exchange!:cool:
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,235
Members
449,092
Latest member
SCleaveland

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top