User question: The Excel Find and Replace dialog drives me crazy. I always have to go to the Options button to specify that it should look in Values. In the figure below, the mouse pointer is showing the value that Excel says is not actually there. Why can’t Excel find a number?
Mr. Excel: Psst, Excel! Try looking under the mouse pointer. You’ve pointed out a lot of the problems with Find and Replace [in Excel]. Let’s take a quick review to uncover some of them. First, when you select Home, Find & Select, Find, Excel presents the simplified version of the Find and Replace dialog without the important settings shown at the bottom of the figure (left).
There are important settings hiding behind the Options button. These settings often cause a Find to fail. Say that you have a calculation for sales tax in column D. Cell D3 shows 70.81 as the result of a formula. By default, Excel searches the formulas instead of the values. If you tried Find without changing Formulas to Values, it will not find $70.81.
Searching the text of the formulas is a bit annoying. How often do you say to yourself,
“Wow, I wonder in which cell I used the SQRTPI function?” But even more annoying
are the other settings, such as Match Case and Match Entire Cell Contents. These settings can be useful, but if you happened to change them at 8:04 a.m. today and haven’t closed Excel since then, even though you’ve opened and closed 40 other workbooks and are working on something completely different, Excel will remember that previous setting. You will often get stung by a strange setting left behind earlier in the day, or even a setting changed when a macro tried to use the Find command with Match Entire Cell Contents turned on.
So why can’t Excel see the 1354.80 value in the figure? Excel is displaying cell C16
with a currency symbol and a comma, and in order to find the cell, you have to search
for $1,354.80! Because Excel’s forté is numbers, it’s rather disappointing that Excel
works like this. But when you understand it, you can work around it.
ADDITIONAL DETAILS: People often ask about how it is possible to search through all sheets in a workbook. You do this by changing the Within dropdown from Sheet to Workbook.
ADDITIONAL DETAILS: Amazingly, Excel can find cells that are displaying as number
signs (#) instead of numbers. Say that you have a column where 5% of the numbers are
showing as #####.
Now, any sane person would make the column wider or turn on Shrink to Fit, but
Excel allows you to perform the following rather crazy set of steps:
1). Select the range of numbers. Press Ctrl+F to display the Find dialog.
2). Type ### in the Find What dialog.
3). If the dialog is not showing the options, click the Options button.
4). Ensure Look In is set to Values and Match Entire Cell Contents is not checked.
5). Instead of clicking Find, click Find All. Excel adds a new section to the dialog, with a list of all the cells that contain ###.
6). While still focusing on the dialog, click Ctrl+A. This will select all the cells in the bottom of the Find All dialog.
You can now format just the selected cells. For example, you could choose
fewer decimals, or a smaller font size, or you could even choose to display the numbers
CAUTION: In Step 6, you are supposed to press Ctrl+A to select all of the found cells.
Be careful that the focus is on the dialog box before pressing Ctrl+A. For example, if
you change the font size, the focus would switch to the worksheet, even though the dialog is still displayed. Pressing Ctrl+A at this point would select all cells in the worksheet instead of just the matching cells. To reestablish focus on the dialog box, you need to click the title bar of the Find and Replace dialog.
This article first appeared in the December 15, 2014, edition of the CFO LearningPro, Excel Edition, newsletter.
CFO contributor Bill Jelen. a.k.a. Mr. Excel, is an Excel MVP and the author of 35 books about Microsoft Excel.