Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Finding All Instances of a Value.
Written by Allen Wyatt (last updated October 1, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021
Mike uses Ctrl+F to find information within cells. This works great with text, but it doesn't do what he needs it to do when searching for numbers. For instance, if he searches for "1500" then it will find any cell that contains the value, regardless of formatting (such as 1500, 1,500, 1,500.00, or $1,500), provided that Mike sets the "Look In" setting in the Find dialog box to "Formulas." But, it won't find 1500 when that value is the result of a formula, such as =750*2.
If Mike sets the "Look In" setting to "Values," then Find only finds the value 1500 along with any formula that returns 1500, provided he doesn't have the cell formatted in some other manner (such as a format that shows the result as $1,500). Mike wonders how he can use Find to find any variation of 1500, regardless of formatting or whether the value is derived by formula or not.
The short answer is that this cannot be done. When you use Excel's Find tool, the Find dialog box includes ways to instruct Excel where it should look for what you want; this is the "Look In" drop-down list. There are three options in the drop-down list:
Looking in Comments should be self-explanatory—Excel limits its searching to any comments in the worksheet. The other two options ignore comments, but find information differently from each other. As Mike notes, a setting of Formulas will find any cell that contains 1500, regardless of the way that the cell is formatted. It won't, however, find a result of 1500 if the value 1500 is not in the formula itself. For example, consider the following two formulas:
=750*2 =1+1500-1
The result of both of these is 1500. However, searching for 1500 with "Look In" set to Formulas will not find the cell with the first formula, but it will find the cell with the second formula. Why? Because the first formula doesn't contain 1500, while the second one does.
If you change the "Look In" drop-down setting to Values, then Excel finds formula results that are 1500, provided there is no formatting that makes the value look differently (such as adding commas or dollar signs).
Regardless of the setting of the "Look In" drop down, something is missing—Excel ignores some results or some values that you don't want ignored. The only way that we've been able to get around this problem and expand what Excel will find is to do a search for "1*500" (without the quote marks) with the "Look In" setting as Values. Excel will then find the 1500 even if there is a dollar sign and a comma in what is shown.
The drawback to this approach is that using the search wildcards in this manner (the asterisk finds any number of characters) results in matches for values such as 321500 or 32178500. This is, of course, because those numbers include the number 1 followed by any number of characters and then the numbers 500. For some instances this can be a bigger drawback than the original problem.
Other than this workaround, we know of no other solution short of creating a macro to do your searching.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8314) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021. You can find a version of this tip for the older menu interface of Excel here: Finding All Instances of a Value.
Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!
Want to use Find and Replace to change the formatting of a cell's contents? You would be out of luck; Excel won't let you ...
Discover MoreWildcard characters can be used within the Find and Replace tool, but what if you want to actually search for those ...
Discover MoreExcel worksheets can contain all sorts of data. One thing you might store in a worksheet is a range of Boolean (TRUE or ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-10-02 11:01:14
J. Woolley
My Excel Toolbox includes the following dynamic array function to return a list of cells matching Value:
=ListMatchingCells(Value,[LookIn],[MatchCase],[MatchEntire],[AllSheets])
Value can be a numeric or text constant or a formula's result or a cell (like A1) with a non-blank value; * and ? are wild card characters and ~ is the escape character, the same as Find (Ctrl+F). If LookIn is "All" then matches are reported for Values, Formulas, Notes, and Comments. For more about ListMatchingCells, see my recent comments here: https://excelribbon.tips.net/T011524_Searching_for_a_Value_Using_a_Function.html
Also, see https://sites.google.com/view/MyExcelToolbox/
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments