Thursday, August 11, 2011

Excel question on substituting characters?

The SUBSTITUTE command will look for all instances of a particular character (or group of characters) and switch them with something else. Using your example code, if you put the function =SUBSTITUTE(A1,"0","P") into B1, the result will be "CPAPAJ111APG" (Excel replaces all the 0's with P's). If you're looking to replace the character (or group of characters) in a specific location in your string, then you want to use the REPLACE command, so to do exactly what you asked about, you'd use this function: =REPLACE(A1,9,1,"0")

No comments:

Post a Comment