Hello all,
I'm looking for a worksheet function that can count the number of occurrences of a string in a cell. For instance the Number of "e"'s in "ajheweewhhdswweeeces".
thnx,
Jivo
Hello all,
I'm looking for a worksheet function that can count the number of occurrences of a string in a cell. For instance the Number of "e"'s in "ajheweewhhdswweeeces".
thnx,
Jivo
Hi,
try
=LEN(A1)-LEN(SUBSTITUTE(A1,"e",""))
VBA Noob
hi Jivo,Originally Posted by Jivo
Try
=LEN(A1)-LEN(SUBSTITUTE(A1,"e",""))
oldchippy![]()
Yahoo says this is the best answer
'1st Step - Write a macro (it needs to be in a module)
'—Open your spreadsheet
'—Alt F11
'—Right-Click on your spreadsheet; Insert | Module
'—Paste this macro in the module
'The macro creates a UDF (User Defined Function) to count characters![]()
Please Login or Register to view this content.
'2nd Step - Create formulas using the new function to count the letters in your string.
'For sake of ease I will assume that your string is in A1
'—Create the list of letters to check in B1:B26 (Type a in B1, b in B2...)
'Make sure to use lowercase letters.
'—Type this formula in C1: =CC(LOWER($A$1),B1)
'Lower is needed in the formula to ensure both upper- and lowercase letters are counted.
'—Copy the formula down alongside the alphabet
'You will now have three things; your string in A1, A through Z in Column B and in Column C you will have count alongside the corresponding letter in Column B
Thanx all for the fast reply!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks