I would do like this with VBA
The C28 you must change with a lastrow value + 1, the lastrow must always be a blank one.![]()
Sub Testing() Dim rng As Range Dim r1 As Long Dim r2 As Long r1 = 1 ' this must be the first row with value>0 For Each rng In Range("C" & r1 & :C28") If rng.Value = 0 Then r2 = rng.Row - 1 rng.Formula = "=SUM(R" & r1 & "C:R" & r2 & "C)" rng.Font.Bold = True r1 = rng.Offset(1, 0).Row End If Next rng End Sub
Bookmarks