ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Counting based on characters. (https://www.excelbanter.com/excel-programming/406267-counting-based-characters.html)

Sinner

Counting based on characters.
 
I have the following list. I want VBA solution to get a count of first
7 characters.


List
03439061122
03439061122
03439061122
03449831122
03452401122
03455251122
03455251122
03455251122
03455251122
03455251122
03455691122
03457711122
03458331122
-----------------------------
Count
0343906 3
0344983 1
0345240 1
0345525 5
0345569 1
0345771 1
0345833 1
________________

Thx.

David

Counting based on characters.
 
Since the last 4 characters are all the same, the count would be the same, if
they are included. If this is not acceptable, you might think of pulling the
first 7 characters out into another column with =left(CellAddress, 7), then
doing a =CountIf(characters, Range). No VBA involved.

David

"Sinner" wrote:

I have the following list. I want VBA solution to get a count of first
7 characters.


List
03439061122
03439061122
03439061122
03449831122
03452401122
03455251122
03455251122
03455251122
03455251122
03455251122
03455691122
03457711122
03458331122
-----------------------------
Count
0343906 3
0344983 1
0345240 1
0345525 5
0345569 1
0345771 1
0345833 1
________________

Thx.


Sinner

Counting based on characters.
 
On Feb 16, 11:41*pm, David wrote:
Since the last 4 characters are all the same, the count would be the same, if
they are included. If this is not acceptable, you might think of pulling the
first 7 characters out into another column with =left(CellAddress, 7), then
doing a =CountIf(characters, Range). No VBA involved.

David



"Sinner" wrote:
I have the following list. I want VBA solution to get a count of first
7 characters.


List
03439061122
03439061122
03439061122
03449831122
03452401122
03455251122
03455251122
03455251122
03455251122
03455251122
03455691122
03457711122
03458331122
-----------------------------
* *Count
0343906 * *3
0344983 * *1
0345240 * *1
0345525 * *5
0345569 * *1
0345771 * *1
0345833 * *1
________________


Thx.- Hide quoted text -


- Show quoted text -


Can we put this left & countif in background (VB) so that calculation
time is minimised?


All times are GMT +1. The time now is 01:17 PM.

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