I briefly explained how to do this for somebody on here a while back. So here's an actual example.
In this recent post, I gave a bash script for logging data to a csv file. I imported todays data into an OpenOffice spreadsheet, and added columns with formulas to calculate todays AHrs generated.
20090414.ods
Column G calculates the minutes between the last 2 readings, and column H calculates the AHrs for that time period by taking the average of the amps at the start and end of the period.
H106 sums the total AHrs.
Amanda