Hi Don!
Here's another method that gives you some flexibility in case you need to change something in the calculation. It uses the Visual Basic capabilities in Excel.
I'm just getting my feet wet in this VBA stuff (doing it for tax calculations), but this example should get you started.
Assuming data is in columns A and B, with the result to go into column C.
- Go to the Visual Basic Editor (hit Alt-F11)
- You want to Insert->Module to get a blank sheet for your VBA program
- Here is my quickie code You may want to copy and paste it into the VBA editor:
Code:
Function DonFunc(InputOperation As Integer, RawData As Double)
'We expect a 1,2,or 3 as input operation
'The value to perform the operation on is the second parameter
Select Case InputOperation
Case 1
DonFunc = RawData / 120
Case 2
DonFunc = RawData / 208
Case 3
DonFunc = RawData / 360
End Select
End Function
- Click on File->Close and return to Excel (it seems to be saved automatically)
- In your cell C1 put the formula: =DonFunc($A1, $B1)
- Copy this cell to the remaining cells in column C
If you need to alter the calculations, just go back into the VBA editor with Alt-F11 and make the changes. Your spreadsheet shouldn't have to change.
Hope this is fairly self-explanatory.
Good luck!
WallyH