A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
AFAIK, Excel formulas are not able to directly detect strikethrough formatting because it’s a visual style, not a cell value. To recognize it, you would need to use VBA (a custom function).
Open the VBA editor with Alt + F11, insert a new module, and paste this code:
Function HasStrikethrough(rng As Range) As Boolean
HasStrikethrough = rng.Font.Strikethrough
End Function
Then return to Excel and use it like a normal formula in your new column:
=HasStrikethrough(A1)
It will return TRUE if the cell has strikethrough formatting and FALSE if it doesn’t.
If your cells may contain mixed formatting (only part of the text struck through), use this version instead:
Function HasPartialStrikethrough(rng As Range) As Boolean
Dim i As Integer
For i = 1 To Len(rng.Value)
If rng.Characters(i, 1).Font.Strikethrough Then
HasPartialStrikethrough = True
Exit Function
End If
Next i
HasPartialStrikethrough = False
End Function
Then call it with:
=HasPartialStrikethrough(A1)
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin