The technique I use is as follows - it's not exact but it gives a very close approximation:
a) First calculate appreciation: appreciation = ending balance - starting balance + contributions - withdrawals.
b) Then calculate the average basis of the account: Avg basis = Starting Balance + sum of each contribution (positive number) and withdrawal (negative number) times days since the contribution or withdrawal divided by total days from the start of the period to now.
c) The average appreciation during the period is then (a) divided by (b).
Here's how to apply to your example with starting balance of $100 in January 2013, withdrawal of $5 in January 2014, ending balance of $108K in July 2014 (183 days after the withdrawal and 548 days from the starting balance date):
a) appreciation = 108-100+5 = 13
b) average basis = 100 -5(183/548) = 98.33
c) calculated return from Jan 2013 to July 2014: 13/98.33 = 13.2%
Going a step further - if you want the average annual return it would be:
^{(365/\text{Days in Period})} )
.
For your example that works out to:
Annual return: