Growing forward, discounting back
Future value grows money forward: a starting amount compounds as amount × (1 + i)^n, and each payment compounds from the period it is made. Present value runs the same arithmetic backwards, turning future money into what it is worth today. As in spreadsheet FV and PV functions, i is the yearly rate divided by the periods a year and n is the number of periods.
FV = PV × (1 + i)^n + PMT × ((1 + i)^n − 1) ÷ i × (1 + i × t)t = 1 when payments come at the start of each period (an annuity due), 0 at the end (an ordinary annuity).
Payments at the start of a period get one extra period of growth, so they end up worth (1 + i) times as much as the same payments at the end.
Example: $1,000 now plus $100 at the end of each month for 10 years at 5% a year (0.4167% a month) grows to $17,175.24, of which $4,175.24 is growth. Microsoft's PV example, $500 a month for 20 years at 8%, is worth $59,777.15 today: try it with the example button.