Hi Hero,
You would need to use VBA for this, as a cell cannot maintain a formula and a static value simultaneously. Once you type a number into G2 it will overwrite the formula.
Right-click on the sheet tab you're using and choose View Code. Paste the following code into the VB Editor window (right side, white space) then close the VB Editor window. Whenever you change cell G2 the macro will be triggered. (Technically it will be triggered on any change, but if it doesn't involve a change to G2 it will skip the procedure.)
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("G2")) Is Nothing Then
If Range("E2").Value = "L" Then
Range("G2").Value = Range("G2").Value - 30
ElseIf Range("E2").Value = "S" Then
Range("G2").Value = Range("G2").Value + 30
Else
' Do nothing, keep G2 as whatever value you entered.
End If
End If
Application.EnableEvents = True
End Sub
Bookmarks