Skip to main content

How to count / sum strikethrough cells in Excel?

Author: Xiaoyang Last Modified: 2025-07-15

In Excel, it is common to apply strikethrough formatting to certain cells in order to mark data as outdated, irrelevant, or invalid. This visual cue can greatly improve data management and help you focus on the information that matters during analysis. However, when it comes to performing calculations—such as counting or summing—you may want to separate the results for strikethrough cells from those without strikethrough. Understanding how to handle these scenarios can streamline your workflow and lead to more accurate insights. This article provides several practical methods to count and sum cells with or without strikethrough formatting in Excel, using customizable VBA functions that offer flexibility for varied data management needs.

Count strikethrough cells with VBA in Excel

Count without strikethrough cells with VBA in Excel

Sum exclude strikethrough cells with VBA in Excel

Count or Sum Cells with Strikethrough Using Kutools for Excel


Count strikethrough cells with in Excel

If you need to determine the total number of cells that have been formatted with strikethrough in a specific range, this can’t be achieved directly with Excel's built-in functions, since there’s no formula that recognizes text formatting like strikethrough. Therefore, using a User Defined Function (UDF) in VBA becomes a practical solution. This approach is especially useful when managing to-do lists, inventory updates, or any scenario where strikethrough is used to indicate completed, invalid, or obsolete data points.

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. In the VBA window, click Insert > Module to create a new module, and then paste the following code into the Module Window.

VBA code: Count strikethrough cells

Public Function CountStrike(pWorkRng As Range) As Long
'Update 20140819
Application.Volatile
Dim pRng As Range
Dim xOut As Long
xOut = 0
For Each pRng In pWorkRng
    If pRng.Font.Strikethrough Then
        xOut = xOut + 1
    End If
Next
CountStrike = xOut
End Function

3. After entering the code, save your workbook (to retain the macro), then close the VBA editor and return to your worksheet. In any blank cell where you want the result to appear, enter the following formula (for example, to check strikethrough cells in the range A2:B14): =CountStrike(A2:B14)

Tip: You can change A2:B14 to any other range that you’d like to check.

count strikethrough cells with user defined function

4. Press the Enter key to execute the formula, and Excel will immediately display the count of all strikethrough cells in the specified range. This allows you to efficiently track progress or remove deprecated entries as needed. See screenshot:

count strikethrough cells result

Precaution: To ensure this VBA code remains available for future use, you must save the file in .xlsm (Excel Macro-Enabled Workbook) format.


Count without strikethrough cells with in Excel

There are cases where you may require the count of only those cells that do not have the strikethrough formatting in a given range. For instance, in project tracking tables or sales data, you often wish to count only the active/valid entries (i.e., those without strikethrough) for further operations. Excel’s default COUNT or COUNTA functions disregard text formatting, so a tailored VBA solution offers precise control over such needs.

1. Press ALT + F11 to launch the Microsoft Visual Basic for Applications window.

2. Go to Insert > Module to add a new code module. Paste the following code into that module window.

VBA code: Count without strikethrough cells

Public Function CountNoStrike(pWorkRng As Range) As Long
'Update 20140819
Application.Volatile
Dim pRng As Range
Dim xOut As Long
xOut = 0
For Each pRng In pWorkRng
    If Not pRng.Font.Strikethrough Then
        xOut = xOut + 1
    End If
Next
CountNoStrike = xOut
End Function

3. Save your macro-enabled workbook, return to the worksheet, and in a blank cell enter the formula (for example, for A2:B14): =countnostrike(A2:B14) Then, press Enter to get the result. Excel will count just those cells within the selected range that do not have strikethrough formatting.

count non strikethrough cells with user defined function

Note: In the above example, A2:B14 is the range of cells being evaluated. Adjust the range reference as needed for your worksheet. Also, be aware that merged cells or special formatting may sometimes affect the results—double-check that your range contains only the intended cells.


Sum exclude strikethrough cells with in Excel

When dealing with numeric data where certain entries are no longer active or should be ignored (i.e., have strikethrough formatting), it’s often essential to sum only the valid numbers. This is common in budget sheets, inventory management, or task tracking, where strikethrough entries represent obsolete or completed items that must be excluded from the totals. Since Excel's built-in SUM function does not distinguish between formatted and non-formatted cells, a User Defined VBA Function is needed for this operation.

1. Use ALT + F11 to open the Microsoft Visual Basic for Applications editor.

2. Click Insert > Module to add a module, and paste the code below into that module window.

VBA code: Sum exclude strikethrough cells

Public Function ExcStrike(pWorkRng As Range) As Long
'Update 20140819
Application.Volatile
Dim pRng As Range
Dim xOut As Long
xOut = 0
For Each pRng In pWorkRng
    If Not pRng.Font.Strikethrough Then
        xOut = xOut + pRng.Value
    End If
Next
ExcStrike = xOut
End Function

3. Save and close the VBA editor. In your target worksheet, choose a blank cell and enter the following formula (e.g., for B2:B14): =excstrike(B2:B14) Press Enter, and Excel will sum only the cells in your specified range that do not have strikethrough formatting, instantly providing a sum that excludes obsolete values.

sum non strikethrough cells with user defined function

Note: Adjust B2:B14 to your actual data range. This function ignores strikethrough cells no matter their value. If you experience unexpected results, ensure all cells have numeric entries and the correct formatting.

Practical tip: If you need to refresh the summation after changing any cell’s strikethrough status, recalculate the worksheet by pressing F9.


Count or Sum Cells with Strikethrough Using Kutools for Excel

If you want to count or sum only the cells that have a strikethrough format, Excel doesn’t offer a built-in way to do this—but Kutools for Excel makes it easy with its Special Filter feature.

1. Select the Column

Click the column that contains the cells with strikethrough formatting.

2. Open the Special Filter

Go to the Kutools Plus tab, then click Special Filter > Filter Strikethrough.

3. Confirm the Filter

A dialog box will appear showing how many cells matched the condition. Click OK to continue.

kutools-filter-result

4. View the Results

The cells with a strikethrough are now filtered and visible. Select the filtered range—you’ll instantly see the Sum, Average, and Count in Excel’s status bar at the bottom.

kutools-count-sum

Why Use Kutools?

Kutools for Excel offers over 300 powerful and easy-to-use features just like this one—helping you save time and boost productivity without writing complex formulas or VBA code.

Whether you're filtering by format, cleaning up data, combining sheets, or batch editing, Kutools simplifies your work in seconds.

 Try Kutools for Excel free for 30 days and explore what you've been missing!


Related articles:

How to sum / count bold numbers in a range of cells in Excel?

How to count and sum cells based on background color in Excel?

How to count / sum cells based on the font colors in Excel?

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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!