Microsoft Office Tutorials and References
In Depth Information
Changing Text
Check out how to use REPLACE with the Inventory Control data from earlier
in the chapter, shown in Figure 16-8. A new task is at hand. To be compatible
with a new computer system, you have to modify the product codes with two
dashes between the vendor ID and the internal tracking number. The original
codes are in Column A. Use a combination of REPLACE and LEFT functions to
get the job done: =REPLACE(A4, 1, 3, LEFT(A4,3) & “--”).
These arguments replace the original three characters in each product code
with the same three characters followed by two dashes. Figure 16-8 shows
how REPLACE alters the product codes. In the figure, the first three product
code characters are replaced with themselves and the dashes. The LEFT
function and the dashes serve as the fourth argument of REPLACE.
Figure 16-8:
Using
REPLACE
to change
text.
Remember a couple of points about REPLACE:
Youneedtoknowwherethetextbeingreplacedisinthelargertext.
Specifically, you have to tell the function at what position the text starts,
and how many positions it occupies.
Thetextbeingreplacedandthenewtexttakingitsplacedon’thaveto
be the same size.
Here’s how to use the REPLACE function:
1. Position the cursor in the cell where you want the result to appear.
2. Enter =REPLACE( to begin the function entry.
Search JabSto ::




Custom Search