Here are some handy calculations and approximations that make sense to me. Maybe someone else will find them useful. Or maybe not. DW claims that I do everything backward.
S = Starting portfolio value.
E = Ending portfolio value
F = net cash Flow = deposits - withdrawals
F must include all money moving in or out of the portfolio. I need to track this anyway, since this is the Withdrawal part of Safe Withdrawal Rate.
G = Gain = E-S-F (Will be negative in the case of a loss.)
If you made all deposits or withdrawals at the end of the period, your percentage gain or loss, also called Return On Investment (ROI), would be G / S. If you made all deposits or withdrawals at the start of the period ROI would be G / (S+F). If your deposits and/or withdrawals are made evenly over the period, a reasonable approximation is
ROI = G / (S+(F/2)).
To obtain an annualized rate of return (IRR) from ROI the formula is
IRR = ((1+ROI)^(d/365)) - 1
Where d = number of days between the start date and the end date and "^" is used as in spread sheet functions to mean "to the power of".
ExHermit