Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 126
Default How to substitute whole word with different designated letters?

Hi,

Is there a way to substitute letters from a word in a cell, with
predifined letters for the whole word?

Cell A1 contains the word. OLE.
Cells O1:O26 have the letters of the alphabet and cells P1:P26 have
the replacement letter.

I need a formula on cell A15 that will take the word OLE in cell A1
and replace all those letters with its match on cells P1:P26.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default How to substitute whole word with different designated letters?

Hi,

Not sure about a formula but here's a UDF. Alt+F11 to open VB editor, Right
click 'This workbook' and insert module and paste the code below in
in A15 enter the formula
=Subst(A1)


Function Subst(oldstring As String) As String
For x = 1 To Len(oldstring)
Mid(oldstring, x, 1) = WorksheetFunction.VLookup(Mid(oldstring, x, 1), _
ActiveSheet.Range("O1:P26"), 2, False)
Next
Subst = oldstring
End Function

Mike

" wrote:

Hi,

Is there a way to substitute letters from a word in a cell, with
predifined letters for the whole word?

Cell A1 contains the word. OLE.
Cells O1:O26 have the letters of the alphabet and cells P1:P26 have
the replacement letter.

I need a formula on cell A15 that will take the word OLE in cell A1
and replace all those letters with its match on cells P1:P26.

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default How to substitute whole word with different designated letters?

Hi,

Here is a formula approach:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,LEFT(A1),LOOK UP(LEFT(A1),C1:C26,D1:D26)),MID(A1,2,1),LOOKUP(MID (A1,2,1),C1:C26,D1:D26)),RIGHT(A1),LOOKUP(RIGHT(A1 ),C1:C26,D1:D26))

I used the range C1:C26 and D1:D26 you should adjust those for you column O:P.

--
Thanks,
Shane Devenshire


" wrote:

Hi,

Is there a way to substitute letters from a word in a cell, with
predifined letters for the whole word?

Cell A1 contains the word. OLE.
Cells O1:O26 have the letters of the alphabet and cells P1:P26 have
the replacement letter.

I need a formula on cell A15 that will take the word OLE in cell A1
and replace all those letters with its match on cells P1:P26.

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How to substitute whole word with different designated letters?

Why repeat-post?
Thought Bernie's UDF solved it for you:
http://tinyurl.com/5wddmo
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:19,500 Files:362 Subscribers:62
xdemechanik
---


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
Substitute letters by others in a word [email protected] Excel Worksheet Functions 4 October 27th 08 12:53 AM
Vlookup using partial word, first 4 letters headly Excel Worksheet Functions 2 June 10th 08 05:58 PM
how do I reduce the spaces between letters in a word? Spaces between letters Excel Discussion (Misc queries) 1 June 10th 08 05:50 PM
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE.... max. limit 8 :( [email protected] Excel Discussion (Misc queries) 6 May 22nd 08 05:33 PM
How do you sort words in Excel by the number of letters in a word Kinger New Users to Excel 2 May 2nd 05 11:42 PM


All times are GMT +1. The time now is 07:56 PM.

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"