Excel Formula: Replace If Cell Contains Specific Text

Excel formulas provide an efficient and reliable way to analyze data and manipulate it for various purposes. One of the most useful Excel formulas is the “Replace If Cell Contains Specific Text” formula, which enables users to quickly and accurately replace specific text within a cell. This formula is incredibly useful for making quick edits to data sets and ensuring accuracy within large data sets. This article will discuss the importance of using the “Replace If Cell Contains Specific Text” formula and its various applications.


You can use the Find and Replace feature in Excel to replace the text in cells only if they contain specific text.

The following example shows how to use this feature in practice.

Example: Replace If Cell Contains Specific Text in Excel

Suppose we have the following dataset that shows the name and position of various basketball players on some team:

Suppose we would like to replace all of the text for each cell in the Position column that contains “Starting” anywhere in the cell.

To do so, highlight the cell range B2:B13.

Then type Ctrl + H to bring up the Find and Replace window.

Then type *Starting* in the Find what box and then type Starter in the Replace with box:

Next, click the Replace All button in the bottom left corner of the window.

The text of each cell that contains Starting anywhere in the cell will now be replaced with Starter.

Excel replace if contains

A message box also appears that tells us a total of 3 replacements were made.

Note that we use asterisks in the Find what box (*Starting*) to specify that we wanted to replace all of the text in the cell if it contained “Starting” anywhere in the string.

If you instead only want to replace the text “Starting” with “Starter” then leave out the asterisks in the Find what box when using the Find and Replace feature.


x