There is a forecast
function built in to Google Spreadsheets that makes this easy to do for simple cases using a linear regression. The docs for forecast are good and clear.
The basic use case is:
FORECAST(x_value_to_forecast,y_axis_set,x_axis_set)
This function combines the steps of calculationscalculating the regression coefficients and applying them to the datasets.