I need to calculate a ratio on the number of days an investor 's funds are used in a portfolio. That's simple, but here's the kicker: the funds can be transferred at several different times and the same investor can contribute several times, which in turn means that those funds can be used at...