ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do i sum a column ignoring cells strikedthrough (https://www.excelbanter.com/excel-worksheet-functions/218469-how-do-i-sum-column-ignoring-cells-strikedthrough.html)

Tracey

how do i sum a column ignoring cells strikedthrough
 


Bernie Deitrick

how do i sum a column ignoring cells strikedthrough
 
Tracey,

With a UDF in VBA:

Function SUMstrike(inR As Range) As Double
Dim myC As Range
For Each myC In inR
If Not myC.Font.Strikethrough Then
SUMstrike = SUMstrike + myC.Value
End If
Next myC
End Function

used like

=SUMstrike(A2:A100)

Note that changing the font of a cell to strikethrough does not fire a calculation, so you will need
to change something else (renenter a number in the range) or do a manual re-calc.

HTH,
Bernie
MS Excel MVP


"Tracey" wrote in message
...





All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com