I have a spreadsheet with four columns: session number, session length in hours, gain/loss for the session, and gain/loss per hour for the session. The session range in length from 0.25 to 3.00 hours.
I would like two additional columns that show gain/loss per hour for the last five hours and gain/loss standard deviation for the last five hours. The problem is there is a different session length in hours for each session, so the formula (script?) would need to be able to determine which of the last few sessions and portion of a session to include to comprise five hours and make the calculation accordingly.
If it helps I will gladly e-mail sample data as an .xls file to anyone interested. Any help would be greatly appreciated.