Export (0) Print
Expand All
ABS
AND
ASC
COS
DAY
DDB
EXP
FV
IF
INT
LEN
LN
LOG
MAX
Me
MID
MIN
MOD
NOT
IS
NPV
ODD
OR
PI
PMT
PV
SIN
SLN
SUM
SYD
T
TAN
VAR
Expand Minimize

REPLACE

Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

REPLACE replaces part of a text string, based on the number of characters you specify, with a different text string.

Syntax

REPLACE ( old_text , start_num , num_chars , new_text )

Old_text is text in which you want to replace some characters.

Start_num is the position of the character in old_text that you want to replace with new_text.

Num_chars is the number of characters in old_text that you want REPLACE to replace with new_text.

New_text is the text that will replace characters in old_text.

Example

Formula

Description (Result)

=REPLACE("abcdefghijk",6,5,"*")

Replaces five characters, starting with the sixth character (abcde*k)

=REPLACE("2009",3,2,"10")

Replaces the last two digits of 2009 with 10 (2010)

=REPLACE("123456",1,3,"@")

Replaces the first three characters with @ (@456)

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft