Calculating the average time between deals

Calculating the average time between deals

Hey all,

I am looking for some help with a deluge script that will calculate the average time between deals for an account.

We create a new deal for most of our accounts (when they re-order) anywhere between 20 - 90 days.

What I want to know is:

Average deal cycle = (last deal date - first deal date) / N# of deals

Thanks!