Extract Vowels and Consonants Separately in Google Sheets

The easiest way to extract vowels and consonants separately in Google Sheets is by using the REGEXREPLACE function. Another option is the SUBSTITUTE function, but I find that formula a bit lengthy, so I prefer to use REGEXREPLACE.

The logic for extracting vowels and consonants is as follows:

  • To extract vowels from a text string, replace all the consonants with an empty string (“”).
  • To extract consonants, replace all the vowels with an empty string (“”). See the examples of how to do this in the formulas below.

Extracting Vowels from a Text String in Google Sheets

Assume cell A1 contains the English alphabet: abcdefghijklmnopqrstuvwxyz. The formula would extract the vowel letters aeiou. Note that I have provided both case-sensitive and case-insensitive formulas for this.

Case-Sensitive Formulas to Extract Vowels

  • Lowercase Vowels:
=REGEXREPLACE(A1,"[^aeiou]", "")

This will return “aeiou”.

  • Uppercase Vowels:
=REGEXREPLACE(A1,"[^AEIOU]", "")

This will return an empty string “”. If the alphabets in A1 are uppercase, it will return “AEIOU”.

These formulas are case-sensitive, meaning they treat lowercase and uppercase letters differently.

Case-Insensitive Formula to Extract Vowels

  • Lower/Upper/Proper Case Vowels:
=REGEXREPLACE(A1,"(?i)[^aeiou]", "")

Extracting Consonants from a Text String in Google Sheets

The formula to extract consonants is almost the same as the formula for extracting vowels. In the above example, we specified the character class for vowels. Here, instead, we will specify the consonants.

Case-Sensitive Formulas to Extract Consonants

Here, I have two separate formulas for lowercase and uppercase letters.

  • Lowercase Consonants:
=REGEXREPLACE(A1, "[^b-df-hj-np-tv-z]", "")
  • Uppercase Consonants:
=REGEXREPLACE(A1, "[^B-DF-HJ-NP-TV-Z]", "")

Case-Insensitive Formula to Extract Consonants

  • Lower/Upper/Proper Case Consonants: This is the recommended formula for removing vowels from a string and extracting the consonants.
=REGEXREPLACE(A1, "(?i)[^b-df-hj-np-tv-z]", "")

Additional Tip: Make a Regex Formula Case-Insensitive Using the LOWER Function

You can use the LOWER or UPPER functions to make a REGEX formula case-insensitive. For example, here’s how you can extract vowels using this method:

  • Vowel Extraction with Case Insensitivity:
=REGEXREPLACE(LOWER(A1),"[^aeiou]", "")

Simply wrap the cell reference with the LOWER function.

Now, for extracting consonants:

  • Consonant Extraction with Case Insensitivity:
=REGEXREPLACE(LOWER(A1), "[^b-df-hj-np-tv-z]", "")

Please note that this will convert the result to lowercase letters since we are using the LOWER function. If you use UPPER instead, it will convert the result to uppercase letters. However, when using UPPER, make sure to use the uppercase character class as well.

You can visit my Google Sheets function guide to explore more REGEX functions.

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Google Sheets: Get the Last Row with Any Data Across Multiple Columns

It’s common to have several empty rows at the bottom of a Google Sheet,...

How to Calculate Digital Root in Google Sheets

The digital root is the single-digit value you get by repeatedly summing the digits...

How to Build an Advanced Book Tracker in Google Sheets: Formulas Explained

If you're tired of forgetting what you've read, which books you rated 5 stars,...

Google Sheets Reading List Tracker Template (Free Download)

Looking for a smarter, more visual way to manage your reading goals? This Google...

More like this

Google Sheets: Get the Last Row with Any Data Across Multiple Columns

It’s common to have several empty rows at the bottom of a Google Sheet,...

How to Calculate Digital Root in Google Sheets

The digital root is the single-digit value you get by repeatedly summing the digits...

How to Build an Advanced Book Tracker in Google Sheets: Formulas Explained

If you're tired of forgetting what you've read, which books you rated 5 stars,...

4 COMMENTS

    • Hi, Julia,

      The following formula will highlight the cell A2 if the first two letters in this cell are consonants.

      =len(regexreplace(left(A2,2),"[aeiou]",))=2

      The same formula can be used for the range A2:A too. There are no changes in the formula.

      Best,

  1. Hi, thanks for this.

    Any way to do it without space.

    E.g. Green Mango > GrnMng

    How about if I would like to get the Initials.

    E.g. Green Mango > GM

    Thanks!

    • The below formula would return the required consonants without space.

      =REGEXREPLACE(A1,"(?i)[aeiou ]", "")

      To extract the initials, that means the first letter in each word, use the following formula.

      =regexreplace(proper(A1), "[^A-Z]", "")

      Best,

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.