Microsoft Office Tutorials and References
In Depth Information
For example, =SUBSTITUTE("Sales Data","Sales","Cost") would generate
“ Cost Data ” .
The SUBSTITUTE function works similarly to a traditional find-and-re-
place command. Compared to the SUBSTITUTE function, the REPLACE function
is difficult enough to make even an old programmer ’ s head spin.
To successfully use REPLACE, you must use functions to determine
the location and number of characters to replace. In most circum-
stances, SUBSTITUTE is easier to use.
REPLACE replaces part of a text string, based on the number of characters
specified, with a different text string. This function takes the following ar-
old_text — This is text in which you want to replace some characters.
start_num — This is the position of the character in old_textthat
you want to replace with new_text.
num_chars — This is the number of characters in old_textthat you
want REPLACE to replace with new_text.
new_text — This is the text that will replace characters in old_text.
to Repeat Text Multiple Times
The REPT function repeats a character or some text a certain number of times.
REPT to Repeat Text Multiple Times
The REPT function repeats text a given number of times. You use REPT to fill
a cell with a number of instances of a text string. This function takes the
text — This is the text you want to repeat.