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>
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
a pivot table would be better
otherwise a countif()
 
Upvote 0
Maybe use the SubTotal Function found on the Ribbon

Data Range
A
B
C
D
1
File Number​
TheDate​
TheCount​
2
8114344​
7/30/2018​
3
8114344​
4/17/2018​
4
8114344​
7/10/2018​
5
8114344 Count​
3​
6
8140397​
6/27/2016​
7
8140397 Count​
1​
8
8702054​
10/27/2016​
9
8702054​
12/27/2016​
10
8702054​
5/26/2017​
11
8702054​
2/14/2017​
12
8702054​
1/27/2017​
13
8702054​
3/28/2017​
14
8702054 Count​
6​
15
8951128​
3/25/2018​
16
8951128 Count​
1​
17
8939187​
1/18/2016​
18
8939187 Count​
1​
19
3565194​
1/11/2016​
20
3565194 Count​
1​
21
3529427​
9/11/2017​
22
3529427 Count​
1​
23
3510635​
9/18/2017​
24
3510635 Count​
1​
25
3504885​
3/7/2016​
26
3504885​
2/29/2016​
27
3504885 Count​
2​
28
3835087​
11/1/2016​
29
3835087​
2/27/2017​
30
3835087​
10/13/2017​
31
3835087​
4/4/2018​
32
3835087​
4/12/2017​
33
3835087​
6/26/2017​
34
3835087 Count​
6​
35
3830017​
9/18/2017​
36
3830017 Count​
1​
37
3825126​
9/1/2016​
38
3825126 Count​
1​
39
3324479​
11/2/2015​
40
3324479 Count​
1​
41
3302125​
5/23/2016​
42
3302125 Count​
1​
43
3614666​
2/9/2016​
44
3614666 Count​
1​
45
3671019​
1/22/2016​
46
3671019​
2/8/2016​
47
3671019 Count​
2​
48
3297700​
8/22/2016​
49
3297700 Count​
1​
50
Grand Count​
31​

<tbody>
</tbody>


EDIT: I like Etaf's suggestion of a Pivot Table. Cleaner and Neater Solution.
 
Last edited:
Upvote 0
I need the count on each actual row, not just a sub total.

I have to group the rows, so I need the number in the third column on each row.
 
Upvote 0
In C2 copied down
=COUNTIF(A:A,A2)
will give you a count of each File Num, but I'm not sure that's what you want.
 
Upvote 0
I need the count on each actual row, not just a sub total.

Show us an example of what you are looking for. This may require a VBA or PQ solution.
 
Upvote 0
Another possibilty
=IF(COUNTIF(A$2:A2,A2)>1,C1,N(C1)+1)

Otherwise as alansidman has said please show us the output that you want along with an explanation
 
Last edited:
Upvote 0
Code:
[TABLE="width: 192"]
 <colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
  [TD="class: xl67, width: 64"]File  Number[/TD]
  [TD="class: xl67, width: 64"]TheDate[/TD]
  [TD="class: xl67, width: 64"]TheCount[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8114344[/TD]
  [TD="class: xl66, align: right"]7/30/2018[/TD]
  [TD="class: xl65, align: right"]1[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8114344[/TD]
  [TD="class: xl66, align: right"]4/17/2018[/TD]
  [TD="class: xl65, align: right"]2[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8114344[/TD]
  [TD="class: xl66, align: right"]7/10/2018[/TD]
  [TD="class: xl65, align: right"]3[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8140397[/TD]
  [TD="class: xl66, align: right"]6/27/2016[/TD]
  [TD="class: xl65, align: right"]1[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8702054[/TD]
  [TD="class: xl66, align: right"]10/27/2016[/TD]
  [TD="class: xl65, align: right"]1[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8702054[/TD]
  [TD="class: xl66, align: right"]12/27/2016[/TD]
  [TD="class: xl65, align: right"]2[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8702054[/TD]
  [TD="class: xl66, align: right"]5/26/2017[/TD]
  [TD="class: xl65, align: right"]3[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8702054[/TD]
  [TD="class: xl66, align: right"]2/14/2017[/TD]
  [TD="class: xl65, align: right"]4[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8702054[/TD]
  [TD="class: xl66, align: right"]1/27/2017[/TD]
  [TD="class: xl65, align: right"]5[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8702054[/TD]
  [TD="class: xl66, align: right"]3/28/2017[/TD]
  [TD="class: xl65, align: right"]6[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8951128[/TD]
  [TD="class: xl66, align: right"]3/25/2018[/TD]
  [TD="class: xl65, align: right"]1[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]8939187[/TD]
  [TD="class: xl66, align: right"]1/18/2016[/TD]
  [TD="class: xl65, align: right"]1[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]3565194[/TD]
  [TD="class: xl66, align: right"]1/11/2016[/TD]
  [TD="class: xl65, align: right"]1[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]3529427[/TD]
  [TD="class: xl66, align: right"]9/11/2017[/TD]
  [TD="class: xl65, align: right"]1[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]3510635[/TD]
  [TD="class: xl66, align: right"]9/18/2017[/TD]
  [TD="class: xl65, align: right"]1[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]3504885[/TD]
  [TD="class: xl66, align: right"]3/7/2016[/TD]
  [TD="class: xl65, align: right"]1[/TD]
 [/TR]
 [TR]
  [TD="class: xl65"]3504885[/TD]
  [TD="class: xl66, align: right"]2/29/2016[/TD]
  [TD="class: xl65, align: right"]2[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
How about
=COUNTIF(A$2:A2,A2)
 
Upvote 0

Forum statistics

Threads
1,215,849
Messages
6,127,276
Members
449,372
Latest member
charlottedv

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