To add a formula in Google Sheets, click the cell where you want the answer, then choose one of the hundreds of functions.
To find the CPI in any year, divide the cost of the market basket in year t by the cost of the same market basket in the base year. To find the CPI in 2004 take the cost of the market basket in 2004 ...