B4: =IF(A4="Subtotal",SUM($B$3:B3),"")
Copy down
Then enter data in the cells above
problem is if you shift Subtotal Up it wont work as the formula will be gone
If you still want a subtotal under those conditions that would require VBA
See this file, the file will work like this, where ever on Sheet1 you will enter Subtotal next cell with get the addition of all numbers from 4th row of the next column to last row with number.