If you are only going to have a limited amount of data, and your only options will be either Sell or Buy, you can set the Formulas in the individual Cells. If Column A contains only Sell or Buy, and Column B will contain the numeric values:
- =IF(A1="Sell",45,-45) 'place in Cell(B1)
For simple summarizing, use the Sum() Function. The following Formula placed in any Cell will Sum the values from B1 to B25 inclusive: