Private Sub Worksheet_Change(ByVal Target As Range)
Dim f1 As Double
Dim result As Integer
f1 = CDbl(Sheets(1).Cells(1, 1).Value)
If f1 < 25000 Then
result = -1
ElseIf f1 < 30000 Then
result = 0
Else: result = CInt((f1 - 20000) / 10000)
End If
Sheets(1).Cells(1, 2).Value = result
End Sub