English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

If I have a cell with many letters, is it possible to count, for example, the number of "A"s?

2006-06-26 08:13:26 · 6 answers · asked by crazymugal 3 in Computers & Internet Software

6 answers

Create a user defined function:

1. Copy this to a module for your worksheet.

Function CountChars(Txt As String, Char As String) As Integer
CountChars = Len(Txt) - Len(Replace(Txt, Char, ""))
End Function

2. If your string is in A!, just enter the function into another cell
Example: countchars(A1,"a")

2006-06-26 09:53:15 · answer #1 · answered by O Caçador 6 · 6 0

Count Specific Characters In Excel

2017-01-19 07:28:48 · answer #2 · answered by ensey 4 · 0 0

I'm not sure what the right way to do this is, but here's a work-around. Click in the cell, then go up to Edit, then Replace. Put the "a" in the "find what" box, then in the replace box, enter a character or number that you know is not in that cell (ie, ~). Hit Replace All. It will tell you how many replacements were made. Then you do the opposite and replace ~ with a to get back to normal.

2006-06-26 08:22:22 · answer #3 · answered by insert_name_here 4 · 0 1

Not that I know of. You *could* do it like this, but it would take longer...

Let cell A1 be the cell you want checked. Let's assume you can only put in 10-letter words.

Starting in another cell, let's say C1, type "MID(A1,0,1)". This will check cell A1, count 0 characters in, and return the next single character.

In cell C2, type "MID(A1,1,1)". This will check cell A1, count 1 character in, and return the next single character. Continue this way until cell c10, which will have "MID(A1,10,1)".

If you then type "hello" into cell A1, the following cells will have the contents:
c1 -> h
c2 -> e
c3 -> l
c4 -> l
c5 -> o
c6-c10 -> (blank)
Then you can use a simple COUNTIF statement on those cells.

2006-06-26 08:21:19 · answer #4 · answered by -j. 7 · 0 0

Try the insert button and press function and then you can look in there and it should tell you or list all the ones you can use..!

I can't give a great deal of info only because I use Excel 2007..

2006-06-26 08:21:30 · answer #5 · answered by Brandon_101 2 · 0 1

I think this involves complex formula but it can be done. Yahoo search of this question can give you more specific answers.

2006-06-26 08:23:06 · answer #6 · answered by GV 2 · 0 1

fedest.com, questions and answers