I know there are several posting similar to this sort of thing. Look at the “money saved” thread which should give you a start I think.
Doing stuff like this is the whole reason that adding the ability to save future values to persistence was added to OH so I know there are people doing this sort of calculation.