MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Dec 25th, 2003, 08:32 PM   #1
bevbevvybbev
 
Join Date: Dec 2003
Posts: 7
Default Vowels and Consonants

Ok, i am writing some stuff to extract different types of word info from rather large tables of words

For instance, all the countries in the world

I need a formula to take vowels from England so you get one column EA
I need a formula to take consonants from England so you get one column NGLND

I then need to have a column for each letter showing which letters are in which word with a number by multiples

Anyway, the vowel/consanant thing seems to be stupidly difficult

Help!

Thanks in advance

Happy New Year

Bev
bevbevvybbev is offline   Reply With Quote
Old Dec 25th, 2003, 08:54 PM   #2
Tana Lee
 
Join Date: Jul 2003
Location: Hawaii
Posts: 284
Default Re: Vowels and Consonants

Aloha...

See if the posts here are of any help:

http://www.mrexcel.com/board2/viewtopic.php?t=72768

Tana-Lee
Tana Lee is offline   Reply With Quote
Old Dec 25th, 2003, 08:59 PM   #3
just_jon
MrExcel MVP
 
just_jon's Avatar
 
Join Date: Sep 2002
Location: Alabama/State of Disarray
Posts: 10,473
Default Re: Vowels and Consonants

See -- http://216.92.17.166/board2/viewtopi...r=asc&start=10
__________________
just_jon
Book of the Month: I'm Not Really an MVP, I Just Play One on TV [j. jon, 2004]
just_jon is offline   Reply With Quote
Old Dec 25th, 2003, 10:03 PM   #4
bevbevvybbev
 
Join Date: Dec 2003
Posts: 7
Default Re: Vowels and Consonants

Man, this is really hard

I thought just extracting the vowels would be easy! It was easy with the consonants, just by nestling 6 SUBSTITUTES and replacing with blanks, I figured that bit out...


But doing that in reverse is a pain

ALSO i've never run macros before and although I know how to program it seems a bit wierd in Excel...I guess I'll get used to it!

thanks, more help still appreciated!
bevbevvybbev is offline   Reply With Quote
Old Dec 25th, 2003, 10:05 PM   #5
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,449
Default Re: Vowels and Consonants

Hi Bev:

In the following macro based approach I have made a couple of assumptions -- 1. that all your entries are in UpperCase; and 2. the letter Y as a Vowel ...

******** ******************** ************************************************************************>
Microsoft Excel - y031225h2.xls___Running: xl97 : OS = Windows 98
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)bout
=

C
D
E
F
1
*VowelsConsonants*
2
ENGLANDEANGLND*
3
AUSTRALIAAUAIASTRL*
4
EGYPTEYGPT*
5
RUSSIAUIARSS*
6
EXCELEEXCL*
7
MICROSOFTIOOMCRSFT*
8
BEVERLEYEEEYBVRL*
Sheet2a*

[HtmlMaker 2.20] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.


I used the followind code that should be installed in a general module ...
Code:
Sub yExtractVowelsAndConsonants()
    For Each cell In Intersect(ActiveSheet.UsedRange, Columns("c"))
        For j = 1 To Len(cell)
            If Asc(Mid(cell, j, 1)) = 65 Or Asc(Mid(cell, j, 1)) = 69 Or _
                Asc(Mid(cell, j, 1)) = 73 Or Asc(Mid(cell, j, 1)) = 79 Or _
                Asc(Mid(cell, j, 1)) = 85 Or Asc(Mid(cell, j, 1)) = 89 Then
                yletV = yletV & Mid(cell, j, 1): cell.Offset(0, 1) = yletV
                Else: yletC = yletC & Mid(cell, j, 1): cell.Offset(0, 2) = yletC
            End If
        Next
        yletV = ""
        yletC = ""
    Next
End Sub
__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old Dec 25th, 2003, 10:52 PM   #6
bevbevvybbev
 
Join Date: Dec 2003
Posts: 7
Default

Thanks

Perhaps I'm being particularly dumb here, but I'm getting syntax errors like crazy by copying that code into the Macro editor
bevbevvybbev is offline   Reply With Quote
Old Dec 25th, 2003, 10:55 PM   #7
tusharm
MrExcel MVP
 
tusharm's Avatar
 
Join Date: May 2002
Posts: 9,695
Default Re: Vowels and Consonants

See my post in http://www.mrexcel.com/board2/viewto...52283&start=10 Put the functions in there in a standard module. Now, suppose your country names are in column A starting with A15. Then, in B15 enter =RegExpSubstitute(A15,"[^aeiouAEIOU]","") and in C15 =RegExpSubstitute(A15,"[aeiouAEIOU]","")

Column B will contain the vowels, C the consonants.
Quote:
Originally Posted by bevbevvybbev
Man, this is really hard

I thought just extracting the vowels would be easy! It was easy with the consonants, just by nestling 6 SUBSTITUTES and replacing with blanks, I figured that bit out...


But doing that in reverse is a pain

ALSO i've never run macros before and although I know how to program it seems a bit wierd in Excel...I guess I'll get used to it!

thanks, more help still appreciated!
__________________
Tushar Mehta (Microsoft MVP Excel 2000-present)
Excel & PowerPoint tutorials and add-ins; custom productivity solutions for MS Office
tusharm is offline   Reply With Quote
Old Dec 25th, 2003, 11:00 PM   #8
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,449
Default Re: Vowels and Consonants

Hi Bev:

The following formula based approach may be of some interest to you --

******** ******************** ************************************************************************>
Microsoft Excel - y031225h2.xls___Running: xl97 : OS = Windows 98
(F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)bout
=

A
B
C
D
E
1
**WordVowelsCosonants
2
E*ENGLANDEANGLND
3
A*AUSTRALIAAIUSTRL
4
I*EGYPTEYGYPT
5
O*RUSSIAAIURSS
6
U*EXCELEXCL
7
Y*MICROSOFTIOMCRSFT
8
**BEVERLEYEYBVRLY
Sheet2c*

[HtmlMaker 2.20] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.


The formula in cell D2 is ...

=MCONCAT(IF(ISNUMBER(FIND($A$2:$A$7,C2)),MID(C2,FIND($A$2:$A$7,C2),1),""))

this is an array formula and uses the MCONCAT function from MoreFunc Add-in

The formula in cell E2 is ...

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(C2,"A",""),"E",""),"I",""),"O",""),"U","")

One caveat here -- you will notice I have produced only one copy of a vowel in a word. Please post back whether this is acceptable or not.
__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old Dec 25th, 2003, 11:07 PM   #9
Yogi Anand
MrExcel MVP
 
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,449
Default

Quote:
Originally Posted by bevbevvybbev
Thanks

Perhaps I'm being particularly dumb here, but I'm getting syntax errors like crazy by copying that code into the Macro editor
Hi Bev:

Where did you install the code -- the code I posted goes in the general module. This what you can do

1. copy the code on the clipboard
2. from within the EXCEL workbook you are working on, press AL+F11, that should take you to the VB Editor
3. In the Project Window, select the wokbook you are working on; insert a Module
4. Paste the code in the large white space to the right
5. Return to the Workbook -- activate the worksheet you are working on and run the macro.

I hope this helps.
__________________
Regards!

Yogi Anand, D.Eng, P.E.
Energy Efficient Building Network LLC
www.energyefficientbuild.com
Yogi Anand is offline   Reply With Quote
Old Dec 26th, 2003, 12:47 AM   #10
bevbevvybbev
 
Join Date: Dec 2003
Posts: 7
Default Re: Vowels and Consonants

Thanks for all your help, learning curve in steep incline but very cool!

I think I tracked down the 'add in' you were talking about and installed it, it seems to be there

however, putting

=MCONCAT(IF(ISNUMBER(FIND($A$2:$A$7,C2)),MID(C2,FIND($A$2:$A$7,C2),1),""))

into a cell just gives me #NAME? - again, I could have done something silly

Obviously the cells in mine are in different places, I get what you are doing with the array idea though

At least I've leaned that that is a cool add in, what an add in is etc

To answer your question unfortunately I was looking to have ALL the vowels show up such as EEIE or IEOE etc

Why the hell I'm doing this on xmas day is anyones guess!! (or you for that matter)

Thanks again from UK

Bev
bevbevvybbev is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 05:18 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2010 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes