As far as I know, the Replace
option has always had only the Formula
option.
Unfortunately, if you just select that option, you will not only replace the values (which are equivalent to formulas), but also any value that happens to be a part of a formula (as, for example, part of a cell reference).
One work-around:
- Select the
Find
option with values andFind All
- Switch to the
Replace
tab- The found references should still be listed
- Enter your
replace with
value - Select the locations listed in the
find all
box- This limits the
Replace
option to those cells only
- This limits the
- Replace all
Note If the values you are replacing are numbers, and not text strings, be sure to change the Find what:
in the Replace dialog with the unformatted version of those numbers (what you would see in the formula bar or with the General
format type).
So in your second screenshot, you can probably just hit Replace All
but in other circumstances, you might want to select all those cells found (select a cell in the range and then ctrl+A
)
Given your example data, you can just Replace
with formulas and it will work, provided you use the non-formatted value:
Before
After
Use the Find and Replace features in Excel to search for something in your workbook, such as a particular number or text string. You can either locate the search item for reference, or you can replace it with something else. You can include wildcard characters such as question marks, tildes, and asterisks, or numbers in your search terms. You can search by rows and columns, search within comments or values, and search within worksheets or entire workbooks.
Find
To find something, press Ctrl+F, or go to Home > Editing > Find & Select > Find.
Note: In the following example, we’ve clicked the Options >> button to show the entire Find dialog. By default, it will display with Options hidden.
-
In the Find what: box, type the text or numbers you want to find, or click the arrow in the Find what: box, and then select a recent search item from the list.
Tips: You can use wildcard characters — question mark (?), asterisk (*), tilde (~) — in your search criteria.
-
Use the question mark (?) to find any single character — for example, s?t finds «sat» and «set».
-
Use the asterisk (*) to find any number of characters — for example, s*d finds «sad» and «started».
-
Use the tilde (~) followed by ?, *, or ~ to find question marks, asterisks, or other tilde characters — for example, fy91~? finds «fy91?».
-
-
Click Find All or Find Next to run your search.
Tip: When you click Find All, every occurrence of the criteria that you are searching for will be listed, and clicking a specific occurrence in the list will select its cell. You can sort the results of a Find All search by clicking a column heading.
-
Click Options>> to further define your search if needed:
-
Within: To search for data in a worksheet or in an entire workbook, select Sheet or Workbook.
-
Search: You can choose to search either By Rows (default), or By Columns.
-
Look in: To search for data with specific details, in the box, click Formulas, Values, Notes, or Comments.
Note: Formulas, Values, Notes and Comments are only available on the Find tab; only Formulas are available on the Replace tab.
-
Match case — Check this if you want to search for case-sensitive data.
-
Match entire cell contents — Check this if you want to search for cells that contain just the characters that you typed in the Find what: box.
-
-
If you want to search for text or numbers with specific formatting, click Format, and then make your selections in the Find Format dialog box.
Tip: If you want to find cells that just match a specific format, you can delete any criteria in the Find what box, and then select a specific cell format as an example. Click the arrow next to Format, click Choose Format From Cell, and then click the cell that has the formatting that you want to search for.
Replace
To replace text or numbers, press Ctrl+H, or go to Home > Editing > Find & Select > Replace.
Note: In the following example, we’ve clicked the Options >> button to show the entire Find dialog. By default, it will display with Options hidden.
-
In the Find what: box, type the text or numbers you want to find, or click the arrow in the Find what: box, and then select a recent search item from the list.
Tips: You can use wildcard characters — question mark (?), asterisk (*), tilde (~) — in your search criteria.
-
Use the question mark (?) to find any single character — for example, s?t finds «sat» and «set».
-
Use the asterisk (*) to find any number of characters — for example, s*d finds «sad» and «started».
-
Use the tilde (~) followed by ?, *, or ~ to find question marks, asterisks, or other tilde characters — for example, fy91~? finds «fy91?».
-
-
In the Replace with: box, enter the text or numbers you want to use to replace the search text.
-
Click Replace All or Replace.
Tip: When you click Replace All, every occurrence of the criteria that you are searching for will be replaced, while Replace will update one occurrence at a time.
-
Click Options>> to further define your search if needed:
-
Within: To search for data in a worksheet or in an entire workbook, select Sheet or Workbook.
-
Search: You can choose to search either By Rows (default), or By Columns.
-
Look in: To search for data with specific details, in the box, click Formulas, Values, Notes, or Comments.
Note: Formulas, Values, Notes and Comments are only available on the Find tab; only Formulas are available on the Replace tab.
-
Match case — Check this if you want to search for case-sensitive data.
-
Match entire cell contents — Check this if you want to search for cells that contain just the characters that you typed in the Find what: box.
-
-
If you want to search for text or numbers with specific formatting, click Format, and then make your selections in the Find Format dialog box.
Tip: If you want to find cells that just match a specific format, you can delete any criteria in the Find what box, and then select a specific cell format as an example. Click the arrow next to Format, click Choose Format From Cell, and then click the cell that has the formatting that you want to search for.
There are two distinct methods for finding or replacing text or numbers on the Mac. The first is to use the Find & Replace dialog. The second is to use the Search bar in the ribbon.
Find & Replace dialog
Search bar and options
-
Press Ctrl+F or go to Home > Find & Select > Find.
-
In Find what: type the text or numbers you want to find.
-
Select Find Next to run your search.
-
You can further define your search:
-
Within: To search for data in a worksheet or in an entire workbook, select Sheet or Workbook.
-
Search: You can choose to search either By Rows (default), or By Columns.
-
Look in: To search for data with specific details, in the box, click Formulas, Values, Notes, or Comments.
-
Match case — Check this if you want to search for case-sensitive data.
-
Match entire cell contents — Check this if you want to search for cells that contain just the characters that you typed in the Find what: box.
-
Tips: You can use wildcard characters — question mark (?), asterisk (*), tilde (~) — in your search criteria.
-
Use the question mark (?) to find any single character — for example, s?t finds «sat» and «set».
-
Use the asterisk (*) to find any number of characters — for example, s*d finds «sad» and «started».
-
Use the tilde (~) followed by ?, *, or ~ to find question marks, asterisks, or other tilde characters — for example, fy91~? finds «fy91?».
-
Press Ctrl+F or go to Home > Find & Select > Find.
-
In Find what: type the text or numbers you want to find.
-
Select Find All to run your search for all occurrences.
Note: The dialog box expands to show a list of all the cells that contain the search term, and the total number of cells in which it appears.
-
Select any item in the list to highlight the corresponding cell in your worksheet.
Note: You can edit the contents of the highlighted cell.
-
Press Ctrl+H or go to Home > Find & Select > Replace.
-
In Find what, type the text or numbers you want to find.
-
You can further define your search:
-
Within: To search for data in a worksheet or in an entire workbook, select Sheet or Workbook.
-
Search: You can choose to search either By Rows (default), or By Columns.
-
Match case — Check this if you want to search for case-sensitive data.
-
Match entire cell contents — Check this if you want to search for cells that contain just the characters that you typed in the Find what: box.
Tips: You can use wildcard characters — question mark (?), asterisk (*), tilde (~) — in your search criteria.
-
Use the question mark (?) to find any single character — for example, s?t finds «sat» and «set».
-
Use the asterisk (*) to find any number of characters — for example, s*d finds «sad» and «started».
-
Use the tilde (~) followed by ?, *, or ~ to find question marks, asterisks, or other tilde characters — for example, fy91~? finds «fy91?».
-
-
-
In the Replace with box, enter the text or numbers you want to use to replace the search text.
-
Select Replace or Replace All.
Tips:
-
When you select Replace All, every occurrence of the criteria that you are searching for is replaced.
-
When you select Replace, you can replace one instance at a time by selecting Next to highlight the next instance.
-
-
Select any cell to search the entire sheet or select a specific range of cells to search.
-
Press Command + F or select the magnifying glass to expand the Search bar and type the text or number you want to find in the search field.
Tips: You can use wildcard characters — question mark (?), asterisk (*), tilde (~) — in your search criteria.
-
Use the question mark (?) to find any single character — for example, s?t finds «sat» and «set».
-
Use the asterisk (*) to find any number of characters — for example, s*d finds «sad» and «started».
-
Use the tilde (~) followed by ?, *, or ~ to find question marks, asterisks, or other tilde characters — for example, fy91~? finds «fy91?».
-
-
Press return.
Notes:
-
To find the next instance of the item you are searching for, press return again or use the Find dialog box and select Find Next.
-
To specify additional search options, select the magnifying glass and select Search in Sheet or Search in Workbook. You can also select the Advanced option, which launches the Find dialog.
Tip: You can cancel a search in progress by pressing ESC.
-
Find
To find something, press Ctrl+F, or go to Home > Editing > Find & Select > Find.
Note: In the following example, we’ve clicked > Search Options to show the entire Find dialog. By default, it will display with Search Options hidden.
-
In the Find what: box, type the text or numbers you want to find.
Tips: You can use wildcard characters — question mark (?), asterisk (*), tilde (~) — in your search criteria.
-
Use the question mark (?) to find any single character — for example, s?t finds «sat» and «set».
-
Use the asterisk (*) to find any number of characters — for example, s*d finds «sad» and «started».
-
Use the tilde (~) followed by ?, *, or ~ to find question marks, asterisks, or other tilde characters — for example, fy91~? finds «fy91?».
-
-
Click Find Next or Find All to run your search.
Tip: When you click Find All, every occurrence of the criteria that you are searching for will be listed, and clicking a specific occurrence in the list will select its cell. You can sort the results of a Find All search by clicking a column heading.
-
Click > Search Options to further define your search if needed:
-
Within: To search for data within a certain selection, choose Selection. To search for data in a worksheet or in an entire workbook, select Sheet or Workbook.
-
Direction: You can choose to search either Down (default), or Up.
-
Match case — Check this if you want to search for case-sensitive data.
-
Match entire cell contents — Check this if you want to search for cells that contain just the characters that you typed in the Find what box.
-
Replace
To replace text or numbers, press Ctrl+H, or go to Home > Editing > Find & Select > Replace.
Note: In the following example, we’ve clicked > Search Options to show the entire Find dialog. By default, it will display with Search Options hidden.
-
In the Find what: box, type the text or numbers you want to find.
Tips: You can use wildcard characters — question mark (?), asterisk (*), tilde (~) — in your search criteria.
-
Use the question mark (?) to find any single character — for example, s?t finds «sat» and «set».
-
Use the asterisk (*) to find any number of characters — for example, s*d finds «sad» and «started».
-
Use the tilde (~) followed by ?, *, or ~ to find question marks, asterisks, or other tilde characters — for example, fy91~? finds «fy91?».
-
-
In the Replace with: box, enter the text or numbers you want to use to replace the search text.
-
Click Replace or Replace All.
Tip: When you click Replace All, every occurrence of the criteria that you are searching for will be replaced, while Replace will update one occurrence at a time.
-
Click > Search Options to further define your search if needed:
-
Within: To search for data within a certain selection, choose Selection. To search for data in a worksheet or in an entire workbook, select Sheet or Workbook.
-
Direction: You can choose to search either Down (default), or Up.
-
Match case — Check this if you want to search for case-sensitive data.
-
Match entire cell contents — Check this if you want to search for cells that contain just the characters that you typed in the Find what box.
-
Need more help?
You can always ask an expert in the Excel Tech Community or get support in the Answers community.
Recommended articles
Merge and unmerge cells
REPLACE, REPLACEB functions
Apply data validation to cells
You can use a formula-based approach if you wish.
It hinges on the EVALUATE()
function which will not work in cell formulas, but WILL work in a Named Range. EVERYONE can do this, EVERY version of Excel. Just type «=EVALUATE(» in a cell and it will look like it isn’t available, but do it right, in a Named Range and it’s good.
So create two Named Ranges, one for each condition. Call one «Formula» and create a Named Range with this in the «Refers to» box:
=EVALUATE(FORMULATEXT(Sheet1!A1))
and create another Named Range called «NotFormula» giving it this in the «Refers to» box:
=EVALUATE(SUBSTITUTE(Sheet1!A1,"*",""))
(If you select the cell next to the cell to work on, A1 assumed here, so park yourself in B1 while creating those Named Ranges which, if you’ll notice, use relative referencing. Choose where to be parked based on where the helper column will exist.)
Then use a «helper column» (etiher right there in the spreadsheets by the inputs, or on another sheet, even one added for this and then deleted. Enter the following formula in it:
=IF(ISFORMULA(A1),Formula,NotFormula)
If it IS a formula, then Formula
is the result. If it is not, then `NotFormula is the result.
Formula
gets the result of FORMULATEXT()
and evaluates it, turning the text string it gives into an actual formula, at least in result if not «technically» so. It’s the only non-macro way I know of achieving that.
NotFormula
simply uses SUBSTITUTE()
to replace the asterisks. No need for the Find and Replace
requirement of putting a tilde before the asterisk. Bear in mind that this process would produce a string in your example since the «1.43» would end up preceded by a space, but this method will make it a real boy, I mean a real number. Might be what you want, might not. If not, in the Named Range, wrap the function in a TEXT()
function to preserve that space.
So, has to have a helper column. That means that if you do not want original and result side by side, but rather replacing the original, you’d need to copy and paste values over the original data, then delete the helper column. If you DO want side by side result and original, you’re gold already.
Remember though, you DO have EVALUATE()
available, you just can’t use it in cells. You have to use it inside a Named Range.
Also, they have been saying for 27 years it could go away. If the «27 years» part does not convince you it is future-safe to use, there are some signs that other things depend on the old Excel 4 macro functionality, what underlaid those functions, not the functions themselves, and that Excel can never really ever get rid of them. So…
Watch Video – Useful Examples of Using Find & Replace in Excel
Last month, one of my colleagues got a data set in Excel, and he was banging his head to clean it. Since I was the only one in the office at that wee hour, he asked me if I could help. I used a simple technique using Find and Replace in Excel, and his data was all clean and polished. He thanked me, packed up, and left office.
He thanked me, packed up, and left office.
Excel Find and Replace feature is super powerful if you know how to best use it.
Using FIND and REPLACE in Excel (4 Examples)
Find and Replace in Excel can save a lot of time, and that is what matters most these days.
In this blog, I will share 4 amazing tips that I have shared with hundreds of my colleagues in my office. The response is always the same – “I wish I knew this earlier. It could have saved me so much of hard labor”.
#1 To Change Cell References Using Excel Find and Replace
Sometimes when you work with a lot of formulas, there is a need to change a cell reference in all the formulas. It could take you a lot of time if you manually change it in every cell that has a formula.
Here is where Excel Find and Replace comes in handy. It can easily find a cell reference in all the formulas in the worksheet (or in the selected cells) and replace it with another cell reference.
For example, suppose you have a huge dataset with formula in that uses $A$1 as one of the cell references (as shown below). If you need to change $A$1 with $B$1, you can do that using Find and Replace in Excel.
Here are the steps to do this:
- Select the cells that have the formula in which you want to replace the reference. If you want to replace in the entire worksheet, select the entire worksheet.
- Go to Home –> Find and Select –> Replace (Keyboard Shortcut – Control + H).
- In the Find and Replace dialogue box, use the following details:
- Find what: $A$1 (the cell reference you want to change).
- Replace with: $B$1 (the new cell reference).
- Click on Replace All.
This would instantly update all the formulas with the new cell reference.
Note that this would change all the instances of that reference. For example, if you have the reference $A$1 two times in a formula, both the instances would be replaced by $B$1.
#2 To Find and Replace Formatting in Excel
This is a cool feature when you want to replace existing formatting with some other formatting. For example, you may have cells with an orange background color and you want to change all these cell’s background color to red. Instead of manually doing this, use Find and Replace to do this all at once.
Here are the steps to do this:
- Select the cells for which you want to find and replace the formatting. If you want to find and replace a specific format in the entire worksheet, select the entire worksheet.
- Go to Home –> Find and Select –> Replace (Keyboard Shortcut – Control + H).
- Click on the Options button. This will expand the dialogue box and show you more options.
- Click on the Find what Format button. It will show a drop-down with two options – Format and Choose Format from Cell.
- Now you need to specify the format that you want instead of the one selected in the previous step. Click on the Replace with Format button. It will show a drop-down with two options – Format and Choose Format from Cell.
- Click on the Replace All button.
You can use this technique to replace a lot of things in formatting. It can pick up and replace formats such as background color, borders, font type/size/color, and even merged cells.
#3 To Add or Remove Line Break
What do you do when you have to go to a new line in an Excel cell.
You press Alt + Enter.
And what do you do when you want to revert this?
You delete it manually.. isn’t it?
Imagine you have hundreds of line breaks that you want to delete. removing line breaks manually can take a lot of time.
Here is the good news, you don’t need to do this manually. Excel Find and Replace has a cool trick up its sleeves that will make it happen in a snap.
Here are the steps to remove all the line breaks at once:
- Select the data from which you want to remove the line breaks.
- Go to Home –> Find and Select –> Replace (Keyboard Shortcut – Control + H).
- In the Find and Replace Dialogue Box:
- Find What: Press Control + J (you may not see anything except for a blinking dot).
- Replace With: Space bar character (hit space bar once).
- Click on Replace All.
And Woosh! It would magically remove all the line breaks from your worksheet.
#4 To Remove Text Using Wildcard Characters
This one saved me hours. I got a list as shown below, and I had to remove the text between parenthesis.
If you have a huge data-set, removing the parenthesis and the text between it can take you hours. But Find and Replace in Excel can do this in less than 10 seconds.
- Select the data
- Go to Home –> Find and Select –> Replace (Keyboard Shortcut – Control + H)
- In the Find and Replace Dialogue Box:
- Find What: (*)
Note I have used an asterisk, which is a wildcard character that represents any number of characters. - Replace With: Leave this Blank.
- Find What: (*)
I hope you find these tips helpful. If there are any other tricks that helped you save time, do share it with us!!
You May Also Like the Following Excel Tips & Tutorials:
- 24 Excel Tricks to Make You Sail through Day-to-day work.
- 10 Super Neat Ways to Clean Data in Excel Spreadsheets.
- 10 Excel Data Entry Tips You Can’t Afford to Miss.
- Suffering from Slow Excel Spreadsheets? Try these 10 Speed-up Tips.
- How to Filter Cells with Bold Font Formatting in Excel.
- How to Transpose Data in Excel.
How to Use Find and Replace in Excel: Full Guide (2023)
Find and Replace is one of the most common yet most resourceful features of Excel.
Searching through hundreds of thousands of rows is definitely not the best thing to do. And to replace something within these rows is even worse.
So Find and Replace lets you find a particular word or phrase in seconds regardless of the volume of the data.
It surely is one of the most needed functions of Excel. If you are yet to use this feature, jump right into the guide below to know all about it 🧐
You can also download our sample workbook for this article here if you want to practice along.
How to use Find and Replace
Using the Find and Replace feature is pretty simple. Press CTRL F to open the dialog box. Or select it from the Editing group.
We have the following example data.
Suppose we want to find Emily, the name of an employee working in a company. To do that, we will enter her name in the Find dialog box as:
Once you type the name, press Enter. Excel will highlight the cell containing the result.
Pro Tip!
Note that the name isn’t capitalized here. That’s because, in the find feature, capitalization doesn’t matter 😉
The Find Next button moves you to the next instance containing the search item by highlighting the cell.
The Find All button shows a list of all the occurrences where the search item occurs. Like this:
You can then choose whichever value you want, and it will direct you to the cell.
If you want to view all the cells at the same time, press CTRL A or manually select the entire list. Excel will highlight all the cells simultaneously:
Replace data with Find and Replace
Now, let’s see how the replace function works
Suppose we want to find the position of Accountant in this data. And replace it with Auditor.
To do this:
- Select Replace tab from the Find and Replace dialog box. Or press CTRL H. You can also open it from the Find & Select option under the Editing group.
- Enter the search term in the Find what box.
- Type in the new term you want to replace the search term with.
- Press Enter.
Note that we entered capitalized search terms. That’s because Replace needs to locate the exact text string. And then replace it with some other term.
Similar to the Find feature in Excel, Replace tab also has the Replace Next and Replace all options.
The Replace Next option replaces each search term one by one.
The Replace All replaces all the terms in one go. And displays a message confirming all the replacements have been made.
And that’s how you use the Find and Replace feature. Pretty easy, no? 😀
Advanced settings of Find and Replace
Now that you know all the basics of Find and Replace, let’s look at some advanced features it has to offer.
To open the advanced functions of the Find feature, click the Options button in the dialog box.
It displays a wide variety of options to choose from.
Note that the list of options for the Find and Replace tab is the same. The only difference is that in Replace tab, you get an additional format option for the replace box.
Let’s study all these options in detail below.
Format: The format option lets you specify the format of the search item. Click the Format option at the top to select a format.
You can also choose the format for your text string from a particular cell. For that,
- Click on the drop-down arrow next to Format.
- Delete the existing format by clicking “Clear Find Format.”
- Click “Choose Format From Cell”
The cursor appears with a dropper.
Just click on the cell whose format you want to copy, and click Replace all. The dialog box also shows a *Preview*.
Within: The within option lets you search a specific text string throughout the entire workbook 😵
So even if you don’t remember where a certain piece of text is in your workbook, you can simply search for it. This feature is actually very helpful when you have to search for a single term from extensive data.
Match Case: The match case option enables case sensitivity. This means that Excel will search for a specific term with the exact capitalization used.
Say we search “hr” in lowercase instead of uppercase and put a checkmark on the ‘Match Case’ option.
Press Find Next.
Excel will show a warning message because we didn’t capitalize the position properly.
If we write the same search term in uppercase, Excel searches and shows the result as:
Isn’t that amazing? 🤩
Search: The search option lets you select the order in which you want to search.
If you want to look for the search item row by row, select “by row”. And if you want to search column by column, select the “by column” option.
Match Entire Cell Contents: This option restricts Find and Replace to look only for characters you have entered in the box. If you even miss a period, Excel will show a warning message.
Say, we put a checkmark on the ‘Match entire cell contents‘ option. And type in the name “John,” whereas, in the data set, the correct name is “John O.”
This is what will happen:
And if we add “O.” to the same box, the result becomes:
Excel returns the correct result. This tool is great if your spreadsheet contains a large amount of data.
Look-in: The look-in option lets you specify the type of data of your search item.
The Find tab offers three types, namely, Formulas, Values, and comments. The Replace tab, on the other hand, uses only one type of data, i.e., Formulas.
If you only want to look for formulas, you can find them using the Go To Special option from Find & Select.
It offers a plethora of options and you can set the options as per your choice. You can use it to find other items too.
Just select the options and Excel will automatically apply them on your next search.
That’s it – Now what
And Tada! That’s how easy and fun it is to use Excel’s Find and Replace tools 🤗
Not only can you find and replace a particular text string in seconds, but you can also specify its format, location, order, and case sensitivity.
Undoubtedly, the Find and Replace feature of Excel is very powerful. But if you want to become an Excel master, there’s so much more you need to learn.
If you are new to this spreadsheet software, we suggest you begin learning Excel’s built-in functions; IF, SUMIF and VLOOKUP.
You can learn these superb functions for FREE in my 30-minute Excel course sent straight to your inbox.
Other resources
The Find and Replace feature in Excel is great. Especially when it comes to making tweaks and narrowing down your search criteria.
The function is easy to understand and use. But with a little more practice, you will be able to master this and make large-scale changes in your data in seconds.
If you like this article, we are sure you’d love to read more. Some related articles include the SEARCH, FIND, REPLACE and SUBSTITUTE functions in Excel.
Frequently asked questions
Frequently asked questions
You can launch the Find and Replace dialog box by pressing CTRL + F.
Or you can find it in the Find & Select Menu under the Editing group from the Home Tab. If you want quick access to the Replace feature, you can use the keyboard shortcut CTRL + H.
If you prefer using formulas to find and replace items in Excel, you should try the SUBSTITUTE function. It is used when you know the exact characters of the text to be replaced. SUBSTITUTE function is a good alternative to Replace.
Kasper Langmann2023-01-19T12:05:02+00:00
Page load link