The method used by the IRS for the Schedule B (for DB plans) is:
i = 2I/(A+B-I), where
A = BOY value
B = EOY value
I = net investment return amount (not rate) = B-A-Contributions+Payments
The result (i) is a rate/percent. This formula assumes all transactions occur in the middle of the period, so it may not be appropriate for all uses, especially if the transactions are "front-loaded" or "back-loaded" in the period. However, it usually provides a reasonable value, even for comparison purposes.