The replacement cost is increasing by 2% annually?
PurchaseCostField + (lifetimeField/12) * CPIfield * PurchaseCostField
I'm also assuming that the CPI field stores the percent as a decimal (0.02 in your example)
Cost * ( 1 + AnnualRate / 12 )^Months
In your formula, the cost compounds each year correct?
That makes sense to me.