Count a frequency of a digit from a list

gfaulds

New Member
Joined
Jan 15, 2014
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I'm trying to count the frequency of the values 0-9 show up in a list of data. Details below. First column is my data, second columns are the numbers and the third is the amount of times that number appears in the list. For example the number 1 value should be 13, since its shows up multiple times for values such as 1, 11, 21, 15, etc. I'm sure its simple but Im not seeing it. Thank you.

I appreciate all the help.


1629916429793.png
 

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.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Try

Pasta1
ABC
1DataNumbersResult
21113
3226
4332
5442
6552
7662
8772
9882
10992
111002
1211
1312
1413
1514
1615
1716
1817
1918
2019
2120
2221
2322
Plan1
Cell Formulas
RangeFormula
C2:C11C2=SUM(IF(IFERROR(--MID(A$2:A$23,{1,2},1),"")=B2,1))
Press CTRL+SHIFT+ENTER to enter array formulas.


M.
 
Upvote 0
A simpler formula

Pasta1
ABC
1DataNumbersResult
21113
3226
4332
5442
6552
7662
8772
9882
10992
111002
1211
1312
1413
1514
1615
1716
1817
1918
2019
2120
2221
2322
Plan1
Cell Formulas
RangeFormula
C2:C11C2=SUMPRODUCT(--(MID(A$2:A$23,{1,2},1)=B2&""))


M.
 
Upvote 0
This will also work (placed in C2:C11, normally entered) no matter how large the numbers in your cells are...
Excel Formula:
=SUMPRODUCT(LEN(A$2:A$23)-LEN(SUBSTITUTE(A$2:A$23,B2,"")))
 
Last edited:
Upvote 0
Solution
Rick,

I think there is a typo in your formula.
Shouldn't the second parameter in SUBSTITUTE be B2 instead of A2?
(BTW, by chance your formula showed the correct result in C11 :cool:)

M.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Apologies. Fixed.
 
Upvote 0
A simpler formula

Pasta1
ABC
1DataNumbersResult
21113
3226
4332
5442
6552
7662
8772
9882
10992
111002
1211
1312
1413
1514
1615
1716
1817
1918
2019
2120
2221
2322
Plan1
Cell Formulas
RangeFormula
C2:C11C2=SUMPRODUCT(--(MID(A$2:A$23,{1,2},1)=B2&""))


M.
Works perfectly. Thank you everyone for the help.
 
Upvote 0
Hello all,

I'm trying to count the frequency of the values 0-9 show up in a list of data. Details below. First column is my data, second columns are the numbers and the third is the amount of times that number appears in the list. For example the number 1 value should be 13, since its shows up multiple times for values such as 1, 11, 21, 15, etc. I'm sure its simple but Im not seeing it. Thank you.

I appreciate all the help.


View attachment 45627
Incidentally, although it's a small sample, it looks to me like your values show signs of developing a Benford curve, in which case when you plug in the rest you won't need to calculate the frequencies, ypu can predict them as follows:
1) 30.1%
2) 17.6%
3) 12.5%
4) 9.7%
5) 7.9%
6) 6.7%
7) 5.8%
8) 5.1%
9) 4.6%

Of course, Benford is about leading digits and so doesn't account for zero and I don't know what kind of data you're working with. The high proportion of 1s and 2s could be a coincidence or a bias, no way to know from a small sample, but it might be worth having a look at Benford's Law and see if it might save you some time.
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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