Hi guys. I need some help.I need to calculated the average number of days taken by a customer to pay us.Example:Customer Amount # Days------------------------------A $500 22A $1200 21A $50 4
Where # Days = the number days taken for Customer A to make full paymentIn the above example, I have a formula to calculate the average days customer A takes to make full payment:Sum((Amount * #Days)) / Sum(Amount)= (500*22)+(1200*21)+(50*4) / (500+1200+50)= 20.8 daysMy table format is belowNote: It contains all customers, not just only 1 customerCust OrderDate PaymentDate Amount-------------------------------------------------A 2013-08-02 2013-08-25 8272.0000A 2013-08-12 2013-08-15 234.0000B 2013-07-15 2013-08-02 129.0000B 2013-08-11 2013-08-21 9238.0000C 2013-06-25 2013-10-02 10293.0000C 2013-07-05 2013-10-02 295.0000C 2013-07-29 2013-10-02 12.0000
The results I need isCustr Total Amount Avg Days---------------------------------A 8506 22.44980014B 9367 10.11017402C 10600 98.68320755
WhereTotal Amount = sum(Amount)Avg Days = Formula indicated aboveThanks