WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-24-2004, 05:35 PM
richkoi's Avatar
richkoi richkoi is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default EXCEL HELP: Extracting Text

I wrote a huge formula using the left(), mid() and possibly right() functions to extract item codes. It was an experimental file and I have lost it!

I have a table with species names... I would like to create an item code that consists of the first two letters of the GENUS, first to letters of the SPECIES (text for this is in ONE cell) and the ## from size. See example below. Bold is the formula I want to create to extract the text.

Genus species, Size, CODE
Bambusa multiplex, 15g, BAMU15
Bambusa oldhamii, 05g, BAOH05

Can anyone help me come up with a formula to extract this information?

Thanks,

P.S. Notice how the code is in all CAPS...is there a way to integrate that into the formula? I believe it is the UPPER() formula...
Reply With Quote
  #2 (permalink)  
Old 08-25-2004, 05:19 PM
steve0 steve0 is offline
WebProWorld Pro
 

Join Date: May 2004
Location: Austin, TX
Posts: 199
steve0 RepRank 0
Default

I understand the first example.. bit a little confused on the second.. where is the 'OH' coming from..?

Try this quickie hack.. assuming your data starts in the first column, first cell A1, and goes down..

=UPPER(LEFT(A1,2)&MID(A1,SEARCH(" ",A1,3)+1,2)&MID(A1,SEARCH(", ",A1,3)+2,2))

explained:
Get the first 2 characters from the left..
Find the position of the first space, and grab the next two characters.. and append..
Find the comma followed by a space, and grab the next two characters.. and append...

Lather, rinse, repeat..
__________________
Hardcore Programming Solutions and Coffee Drinker
Reply With Quote
  #3 (permalink)  
Old 08-25-2004, 05:35 PM
richkoi's Avatar
richkoi richkoi is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

BAmbusa OLdhamii

That is where the BAOH comes from.

Thanks, I'll try your formula now.

Rich
Reply With Quote
  #4 (permalink)  
Old 08-25-2004, 05:37 PM
richkoi's Avatar
richkoi richkoi is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

ooops...I guess we have been using the wrong item code for that plant all along. It should be BAOL

THANKS!

Rich
Reply With Quote
  #5 (permalink)  
Old 08-25-2004, 05:42 PM
richkoi's Avatar
richkoi richkoi is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

...your formula gave me an error. I see that the entire formula points to A1, where it should point to A1 and A2. See example below:



Let me know if you can modify the formula to produce the above. Thanks!

Rich
Reply With Quote
  #6 (permalink)  
Old 08-25-2004, 07:22 PM
steve0 steve0 is offline
WebProWorld Pro
 

Join Date: May 2004
Location: Austin, TX
Posts: 199
steve0 RepRank 0
Default

Hi Rich,

I thought ALL the text was in one cell (e.g. A1)..
if the number is in the next cell (B1)..

Go with:

=UPPER(LEFT(A1,2)&MID(A1,SEARCH(" ",A1,3)+1,2)&LEFT(B1,2))

-Steve
__________________
Hardcore Programming Solutions and Coffee Drinker
Reply With Quote
  #7 (permalink)  
Old 08-26-2004, 01:23 PM
richkoi's Avatar
richkoi richkoi is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

Great! Thanks a lot, works like a charm.

Rich
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: excel, extracting, help, text



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Search Engine Friendly URLs by vBSEO 3.0.0