=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :(

L

lari.saukkonen

I'm having a problem while using excel 2002.
I have an estimated amount of 3500 cells containing text.

I also have 450 words and for all of them I have abbreviations.

What is the easiest way for me to manipulate those 3500
cells so that if they contained a word defined in this list of
450 words so that those words will be transformed into
each abbreviation?
 
B

Bob Phillips

VBA. Have an Excel table of words and replacements, then loop through all of
the cells, then loop through the list checking for matches.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
L

lari.saukkonen

VBA. Have an Excel table of words and replacements, then loop through all of
the cells, then loop through the list checking for matches.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Now that is beyond my skills :(
 
L

lari.saukkonen

Can you post some examples?
Here's a part from a file that contains triggerwords and those that
should replace them:
KAAPELITILA,KAAPELITIL:KAAPTI
KAAPELI:KAAP
KAAVIO:KAAV
KALANTERI,KALANT:KAL

I have the target file filled with text. For example one line goes:
POISTOPUHALLIN, AUTOM. TILAN KAAPELITILA (2381K4)
so this should be replaced with
POISTOPUHALLIN, AUTOM. TILAN KAAPTI (2381K4)
 
T

T. Valko

Ok, this works but may not be 100% successful. With string matches there's
almost always the chance of false positives. Also note that if there is more
than one keyword in a string this won't work properly.

Create a 2 column table with the keywords in the left column and the
replacement words in the right column. This table *must* be sorted in
ascending order based on the keyword:

KAAPELI ............KAAP
KAAPELITIL.......KAAPTI
KAAPELITILA....KAAPTI
KAAVIO.............KAAV
KALANT............KAL
KALANTERI......KAL

Assume this table is in the range C1:D6

A1 =
POISTOPUHALLIN, AUTOM. TILAN KAAPELITILA (2381K4)

This formula:

=SUBSTITUTE(A1,LOOKUP(2,1/SEARCH(C$1:C$6,A1),C$1:C$6),LOOKUP(2,1/SEARCH(C$1:C$6,A1),D$1:D$6))

Returns:

POISTOPUHALLIN, AUTOM. TILAN KAAPTI (2381K4)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top