Hilary has formulas scattered throughout a workbook that contain a particular function. She wants to replace that function with a different approach, but the first step is to locate the formulas she needs to change. Hilary wonders how she can locate every formula containing a specific function without also finding cells that merely contain the function's name as text.
If you only need to find specific functions once in a while, then you can use Find and Replace to do the searching. Let's say, for instance, that you want to find formulas that contain the GAMMA function. You can follow these steps:

Figure 1. The Find tab of the Find and Replace dialog box.
At this point, Excel selects the first cell that includes the GAMMA function. It is important to use the opening parenthesis in step 4, as this will help ensure that text-only mentions of GAMMA are skipped.
If you need to repeat the same process regularly, then your best bet may be to create a macro to assist. All you need to do is have the macro ask for the function to be located, and then it can do the rest. Here's an example:
Sub FindTextInFormulas()
Dim c As Range
Dim searchText As String
Dim searchRange As Range
Dim numFound As Long
Dim sMsg As String
searchText = InputBox("Enter the function name to find in formulas:")
If Len(searchText) > 0 Then
searchText = Ucase(searchText) & "("
On Error Resume Next
Set searchRange = Selection.SpecialCells(xlCellTypeFormulas)
On Error GoTo 0
If searchRange Is Nothing Then
sMsg = "No formulas found in the selected range"
Else
numFound = 0
For Each c In searchRange
If InStr(1, c.Formula, searchText, vbBinaryCompare) > 0 Then
c.Interior.Color = vbYellow
numFound = numFound + 1
End If
Next c
sMsg = "No matches found"
If numFound > 0 Then
sMsg = "Found " & numFound & " cells with that function"
End If
End If
MsgBox sMsg, vbInformation
End If
End Sub
To use the macro, select the cells you want to check and then run it. The only thing the macro changes is the color fill of any cells that contain the text you want. Notice that the macro also converts the user-entered text to uppercase and appends an opening parenthesis to the string. When combined with setting the fourth parameter of the InStr function to vbBinaryCompare, this helps ensure that there are very few "false positives" in what the macro does.
Note:
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (14001) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!
Excel worksheets can contain all sorts of data. One thing you might store in a worksheet is a range of Boolean (TRUE or ...
Discover MoreIf you need to find where line breaks are located in cells, there are a couple of ways you can proceed. Here's a quick ...
Discover MoreUsing Find and Replace is something quite routine in Excel, as it easily allows you to find and replace information in ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2026-09-13 14:10:18
J. Woolley
My Excel Toolbox includes the following dynamic array function to return all non-blank formulas from a Target range of cells on any worksheet:
=ListFormulas(Target, [WithValues], [SkipConstants], [SkipHeader])
Expect 2 columns (Cell, Formula) or 3 columns (Cell, Formula, Value) and N rows (plus header). When SkipConstants is TRUE only formulas that begin with = are returned.
If this function is in cell B1 (for example), the following formula in cell A2 will create a hyperlink to the formula located at the Cell value identified in B2:
=HYPERLINK("[?]"&B2)
That formula can be dragged down column A for a hyperlink to each item in the list created by ListFormulas.
See https://sites.google.com/view/MyExcelToolbox/
2026-09-05 05:19:17
Alex Blakenburg
In the manual Find & Replacement method a couple of useful options are:
• If you click on the Find All button it will pop up a list of all the cells found. If you then click on one of the items in the list and hit Ctrl+A it will select them all in the worksheet.
• In Find Next. You can close the Find dialogue box and by hitting F4 it will perform a Find Next and cycle through all the identified cells.
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 © 2026 Sharon Parq Associates, Inc.
Comments