Leading the way in Microsoft Office Development
 Home|Excel|Word|PowerPoint|Consultancy|Feedback|Contact 
 Microsoft Excel > Functions > Text > REPLACE

 

REPLACE(old_text, start_num, num_chars, new_text)

 
 Returns the text string with a number of characters replaced.

 old_textThe text you want to replace.
 start_numThe position of the character in "old_text" that is to be replaced.
 num_charsThe number of characters in "old_text" that you want replaced.
 new_textThe text you want to replace "old_text" with.

 REMARKS
 
  • This function should be used when you want to replace text that occurs in a specific location in a text string.
     
  • This function is very similar to the SUBSTITUTE() function.
     
  • There is also a REPLACEB() function which can be used with languages that use the double-byte character set.

     EXAMPLES
     
     A
    1=REPLACE("1990",3,2,"91") = 1991
    2=REPLACE("1990",3,2,"91") = 1991
    3=REPLACE("abcdefghijk",6,5,"*") = abcde*k
    4=REPLACE("oldtext",1,LEN("oldtext")-4,"newtext") = newtexttext
     

     Functions - R | Index - R | Text Manipulation | Office Online 

     Copyright © 2004-2007 Better Solutions Limited. All Rights Reserved.Top