I've used Doug Runchey's formula to set up my own spreadsheet in the past, but when I got closer to retirement, had him do calculations several times for different scenarios for greater accuracy. (He will use months instead of general years to get the calculation much closer to actual than I would bother with.)
When I got into retirement, I had him re-run a few scenarios to check my planned dates for receiving CPP. (He provides tables showing cumulative totals of payments starting different months / years of age to show which ages provide the greatest total amounts, given different lifespans.)