The payback period refers to the time needed to recoup an investment. Besides the initial investment, you should take into account the cash flow generated.
Let’s say that you have the following:
I = Initial investment
CF = Yearly cash flow of the investment
Assume for simplicity that the yearly cash flow is constant and there is no time value of money.
The payback period would be :
Payback period = I / CF
If the cash flow is not constant or there is time value of money, the formula becomes more complex, due to the fact the cash flow changes every year.
Hope this helps,