Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Andy100
 
Posts: n/a
Default SUBSTITUTE (more than one in Excel ?)

Using the SUBSTITUTE function in Excel 2002, can i have more than one
substitute in a column ??

I have an excel sheet, e.g. Col A i want to change everytime it sees "BAW"
to "British Airways", but also whenever it sees "BAA" i need it to change to
"British Airports Authority". There are many more substitutions i need to
make but i can only get it to work with one at a time !!

Cheers
Andy


  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Andy,

Make up a table of your substitutions (say, in X1:Y100, with codes in column X and full values in
Y), and use a formula like

=VLOOKUP(A1,$X$1:$Y$100,2,False)

HTH,
Bernie
MS Excel MVP


"Andy100" wrote in message ...
Using the SUBSTITUTE function in Excel 2002, can i have more than one
substitute in a column ??

I have an excel sheet, e.g. Col A i want to change everytime it sees "BAW"
to "British Airways", but also whenever it sees "BAA" i need it to change to
"British Airports Authority". There are many more substitutions i need to
make but i can only get it to work with one at a time !!

Cheers
Andy




  #3   Report Post  
Andy100
 
Posts: n/a
Default

I can see what you mean, but in my example it doesn't work because i need it
to replace text within text, not a whole word.

In my data i have e.g. BAW9999, and i want it to change that to
SPEEDBIRD9999, so it's not looking for a whole word, but text within a word
and replacing it.

Thanks for the help and speedy reply !!


Kind Regards
Andrew



"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Andy,

Make up a table of your substitutions (say, in X1:Y100, with codes in

column X and full values in
Y), and use a formula like

=VLOOKUP(A1,$X$1:$Y$100,2,False)

HTH,
Bernie
MS Excel MVP


"Andy100" wrote in message

...
Using the SUBSTITUTE function in Excel 2002, can i have more than one
substitute in a column ??

I have an excel sheet, e.g. Col A i want to change everytime it sees

"BAW"
to "British Airways", but also whenever it sees "BAA" i need it to

change to
"British Airports Authority". There are many more substitutions i need

to
make but i can only get it to work with one at a time !!

Cheers
Andy






  #4   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

=SUBSTITUTE(SUBSTITUTE(A2,"BAW","SPEEDBIRD"),"BAA" ,"British Airports
Authority")



--
Regards,

Peo Sjoblom

(No private emails please)


"Andy100" wrote in message
...
I can see what you mean, but in my example it doesn't work because i need
it
to replace text within text, not a whole word.

In my data i have e.g. BAW9999, and i want it to change that to
SPEEDBIRD9999, so it's not looking for a whole word, but text within a
word
and replacing it.

Thanks for the help and speedy reply !!


Kind Regards
Andrew



"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Andy,

Make up a table of your substitutions (say, in X1:Y100, with codes in

column X and full values in
Y), and use a formula like

=VLOOKUP(A1,$X$1:$Y$100,2,False)

HTH,
Bernie
MS Excel MVP


"Andy100" wrote in message

...
Using the SUBSTITUTE function in Excel 2002, can i have more than one
substitute in a column ??

I have an excel sheet, e.g. Col A i want to change everytime it sees

"BAW"
to "British Airways", but also whenever it sees "BAA" i need it to

change to
"British Airports Authority". There are many more substitutions i need

to
make but i can only get it to work with one at a time !!

Cheers
Andy







  #5   Report Post  
Andy100
 
Posts: n/a
Default

Cheers Peo ! - That works !

Kind Regards

Andrew




"Peo Sjoblom" wrote in message
...
=SUBSTITUTE(SUBSTITUTE(A2,"BAW","SPEEDBIRD"),"BAA" ,"British Airports
Authority")



--
Regards,

Peo Sjoblom

(No private emails please)


"Andy100" wrote in message
...
I can see what you mean, but in my example it doesn't work because i need
it
to replace text within text, not a whole word.

In my data i have e.g. BAW9999, and i want it to change that to
SPEEDBIRD9999, so it's not looking for a whole word, but text within a
word
and replacing it.

Thanks for the help and speedy reply !!


Kind Regards
Andrew



"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Andy,

Make up a table of your substitutions (say, in X1:Y100, with codes in

column X and full values in
Y), and use a formula like

=VLOOKUP(A1,$X$1:$Y$100,2,False)

HTH,
Bernie
MS Excel MVP


"Andy100" wrote in message

...
Using the SUBSTITUTE function in Excel 2002, can i have more than one
substitute in a column ??

I have an excel sheet, e.g. Col A i want to change everytime it sees

"BAW"
to "British Airways", but also whenever it sees "BAA" i need it to

change to
"British Airports Authority". There are many more substitutions i

need
to
make but i can only get it to work with one at a time !!

Cheers
Andy











  #6   Report Post  
Andy100
 
Posts: n/a
Default

Sorry to bother you again, but what about 3 or more substitutions ?
Following on from your formula i tried to input more than the two in your
example but got errors ! - i tried:
SUBSTITUTE(SUBSTITUTE((A2,"BAW","SPEEDBIRD "),"EZY","EASYJET
"),"MYT","KESTREL ")

but i kept on getting errors, what pattern will it follow for 3 or more ?

Kind Regards
Andrew




"Andy100" wrote in message
...
Cheers Peo ! - That works !

Kind Regards

Andrew




"Peo Sjoblom" wrote in message
...
=SUBSTITUTE(SUBSTITUTE(A2,"BAW","SPEEDBIRD"),"BAA" ,"British Airports
Authority")



--
Regards,

Peo Sjoblom

(No private emails please)


"Andy100" wrote in message
...
I can see what you mean, but in my example it doesn't work because i

need
it
to replace text within text, not a whole word.

In my data i have e.g. BAW9999, and i want it to change that to
SPEEDBIRD9999, so it's not looking for a whole word, but text within a
word
and replacing it.

Thanks for the help and speedy reply !!


Kind Regards
Andrew



"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Andy,

Make up a table of your substitutions (say, in X1:Y100, with codes in
column X and full values in
Y), and use a formula like

=VLOOKUP(A1,$X$1:$Y$100,2,False)

HTH,
Bernie
MS Excel MVP


"Andy100" wrote in message
...
Using the SUBSTITUTE function in Excel 2002, can i have more than

one
substitute in a column ??

I have an excel sheet, e.g. Col A i want to change everytime it

sees
"BAW"
to "British Airways", but also whenever it sees "BAA" i need it to
change to
"British Airports Authority". There are many more substitutions i

need
to
make but i can only get it to work with one at a time !!

Cheers
Andy











  #7   Report Post  
Leo Heuser
 
Posts: n/a
Default

Hi Andrew

Each SUBSTITUTE returns a string, which you must
make a new SUBSTITUTE to, so

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"BAW","SPEEDBI RD "),"EZY","EASYJET
"),"MYT","KESTREL ")

will do the job.

--
Best Regards
Leo Heuser

Followup to newsgroup only please.


"Andy100" skrev i en meddelelse
...
Sorry to bother you again, but what about 3 or more substitutions ?
Following on from your formula i tried to input more than the two in your
example but got errors ! - i tried:
SUBSTITUTE(SUBSTITUTE((A2,"BAW","SPEEDBIRD "),"EZY","EASYJET
"),"MYT","KESTREL ")

but i kept on getting errors, what pattern will it follow for 3 or more ?

Kind Regards
Andrew




"Andy100" wrote in message
...
Cheers Peo ! - That works !

Kind Regards

Andrew




"Peo Sjoblom" wrote in message
...
=SUBSTITUTE(SUBSTITUTE(A2,"BAW","SPEEDBIRD"),"BAA" ,"British Airports
Authority")



--
Regards,

Peo Sjoblom

(No private emails please)


"Andy100" wrote in message
...
I can see what you mean, but in my example it doesn't work because i

need
it
to replace text within text, not a whole word.

In my data i have e.g. BAW9999, and i want it to change that to
SPEEDBIRD9999, so it's not looking for a whole word, but text within
a
word
and replacing it.

Thanks for the help and speedy reply !!


Kind Regards
Andrew



"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
Andy,

Make up a table of your substitutions (say, in X1:Y100, with codes
in
column X and full values in
Y), and use a formula like

=VLOOKUP(A1,$X$1:$Y$100,2,False)

HTH,
Bernie
MS Excel MVP


"Andy100" wrote in message
...
Using the SUBSTITUTE function in Excel 2002, can i have more than

one
substitute in a column ??

I have an excel sheet, e.g. Col A i want to change everytime it

sees
"BAW"
to "British Airways", but also whenever it sees "BAA" i need it to
change to
"British Airports Authority". There are many more substitutions i

need
to
make but i can only get it to work with one at a time !!

Cheers
Andy













Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Group" function very slow with Excel 2003 :( ... While very quick with Excel2000 :O) Alain79 Excel Discussion (Misc queries) 4 June 14th 05 07:34 AM
Stop Excel Rounding Dates leinad512 Excel Discussion (Misc queries) 1 April 20th 05 04:19 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM
Excel error - Startup (and Acrobat PDFMaker) gxdata Setting up and Configuration of Excel 0 February 4th 05 03:44 AM
Excel 2002 and 2000 co-install. Control Which Starts ? cnuk Excel Discussion (Misc queries) 2 January 17th 05 08:07 PM


All times are GMT +1. The time now is 02:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"