Searching and Replacing within a String in Excel 2007

Excel Formula Add comments

You can use the REPLACE function in conjunction with the SEARCH function to replace part of a text string with another string. In effect, you use the SEARCH function to find the starting location used by the REPLACE function.

For example, assume cell A1 contains the text Annual Profit Figures. The following formula searches for the word Profit and replaces those six characters it with the word Loss:

=REPLACE(A1,SEARCH("Profit",A1),6,"Loss")

This next formula uses the SUBSTITUTE function to accomplish the same effect in a more efficient manner:

=SUBSTITUTE(A1,"Profit","Loss")

Popularity: 6% [?]

Related Post

  • Finding and Searching within a String in Excel 2007
  • Replacing Text with Other Text in Excel 2007
  • Repeating a Character or String & Text Histogram in excel 2007
  • Extracting Characters from a String in Excel 2007
  • Replacing Fonts Throughout a Presentation in Powerpoint 2007
  • Don't Find What You're Looking For? Please Try Here...

    Google
     

    Leave a Reply

    WP Theme & Icons by N.Design Studio
    Entries RSS Comments RSS Add to Technorati Favorites Log in