Count number of occurrences of list of characters in a single string

VorLag

Board Regular
Joined
May 13, 2013
Messages
205
I am trying to figure out a good way to do this... So, let's say I want to count the number of vowels in a word... how would I do this?

I don't want to have to do a separate formula for each vowel and I can't seem to get an array formula to work. Does anyone have any ideas?

The list will look like this:

ABCDEFGHI
1Word List# VowelsVowels
2CupcakeA
3ArgyleE
4LiquidatorI
5OctopusO
6GrassU
7Y

<tbody>
</tbody>
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I'm sure there are other methods, but I'd probably just use a LEN/Substitute combination.

For example calculating the number of times "a" shows up in a string:
=LEN(A2)-LEN(SUBSTITUTE(LOWER(A2),"a",""))

Calculating the number of times any vowel shows up in a string:
=LEN(A2)-LEN(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LOWER(A2),"a",""),"e",""),"i",""),"o",""),"u",""))
 
Upvote 0
As the formula should be copied down i suggest a slight modification

=SUMPRODUCT(--(MID(A1,ROW($1:$999),1)={"a","e","i","o","u"}))

M.
 
Upvote 0
As the formula should be copied down i suggest a slight modification

=SUMPRODUCT(--(MID(A1,ROW($1:$999),1)={"a","e","i","o","u"}))
Good point! I was so intent on getting the formula to work that I forgot it would be copied down. Thanks for picking up on that.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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