A formula for column "C" (constants) is relatively simple...
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B1,"A",""),"E",""),"I",""),"O",""),"U","")
but to do the same thing for vowels would require 20 nested SUBSTITUTE function calls. You can do that if you want, but personally, I would create two UDFs (user defined functions) and use them instead. So, once you install them as described below, then you can use them just like any other built-in Excel function. So, you would put these formulas in the indicated cells and then just copy them down to the end of your data...
C1: =Consonats(B1)
D1: =Vowels(B1)
Okay, here is the code for these functions...
Code:
Function Vowels(ByVal S As String) As String
Dim X As Long
For X = 1 To Len(S)
If Mid(S, X, 1) Like "[!AEIOU]" Then Mid(S, X) = " "
Next
Vowels = Replace(S, " ", "")
End Function
Function Consonants(ByVal S As String) As String
Dim X As Long
For X = 1 To Len(S)
If Mid(S, X, 1) Like "[AEIOU]" Then Mid(S, X) = " "
Next
Consonants = Replace(S, " ", "")
End Function
Note: These functions assume the text they are working one are all upper case letters as your example showed.
HOW TO INSTALL UDFs
------------------------------------
If you are new to UDFs, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the above code into the code window that just opened up. That's it.... you are done. You can now use
Vowels and
Consonants just like they were built-in Excel functions as described above.
If you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.