In this code its a formula I underline it . Now How can I modified it to =Sum two cells above meaning this code puts this formula in collumn (G) whenever there is a S in collumn (E) it would place the formula of the right of it in collumn (G). Now how can I modified the formula in the code instead of divding it would Sum only 2 cells above the formula?

E.Offset(0, 2).Formula = "=D" & E.Row & "/(D" & E.Row & "+C" & E.Row & ")"



Public Sub LookForSv2()
'if ECol = S then (E2="S",D2/(D2+C2),"")
With ActiveSheet.Columns("E:E")
Set E = .Find("S", LookIn:=xlValues, lookat:=xlWhole)
If Not E Is Nothing Then
firstAddress = E.Address
Do
E.Offset(0, 2).Formula = "=D" & E.Row & "/(D" & E.Row & "+C" & E.Row & ")"

Set E = .FindNext(E)
Loop While Not E Is Nothing And E.Address <> firstAddress
End If
End With
End Sub

Thanks!