How to filter cells with formulas in Excel?
If you have a long list of data which contains both values and formulas, and now, you need to filter only the formula rows. Have you ever tried to solve this problem in Excel?
Filter cells with formulas with User-defined formula and a helper column
To filter cells which containing the formulas, you need to identify the formulas cells with a User Defined Function first, and then apply the Filter feature to the new helper column.
1. Hold down the Alt + F11 keys in Excel, and it opens the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following macro in the Module Window.
VBA code: Identify the cells which contain formulas
Function HasFormula(Cell)
HasFormula = Cell.HasFormula
End Function
3. Then save and close this code, return to the worksheet, and enter this formula =HasFormula(A2) into a blank cell B2, for example, see screenshot:
4. And then drag the fill handle over to the range cells that you want to apply this formula, you will get TRUE or FALSE in the cells, TRUE stands for the cells which have formulas and FALSE indicates no formulas. See screenshot:
5. Then select this new column B, and click Data > Filter, then click the drop down arrow in cell B1, and check TRUE option under the Select All section, see screenshot:
6. After checking the TRUE option, click OK button to close this dialog, and only the formulas rows are filtered out as follows:
7. Finally, you can remove the contents in Column B as you want.

Unlock Excel Magic with Kutools AI
- Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
- Custom Formulas: Generate tailored formulas to streamline your workflows.
- VBA Coding: Write and implement VBA code effortlessly.
- Formula Interpretation: Understand complex formulas with ease.
- Text Translation: Break language barriers within your spreadsheets.
Related articles:
How to filter cells with comments in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!