The calculation is based on the money weighted return which is commonly used to account for fluctuations of the principle over the reporting period.
To understand the theory behind the formula you can refer to the user guides here. You can also unprotect the template to view the components of the formula or modify it to create a straight return and ignoring the timing. If you are still using the trial version and do not yet have the unprotection password, you can reply to the notification email of this post and we will send it through to you.