Excel FORECAST Function: How to Use It

Formulas & functions · Updated November 23, 2026

The FORECAST function in Excel predicts a future value by using existing x- and y-values and linear regression. Its syntax is =FORECAST(x, known_ys, known_xs), where x is the data point you want to predict for, known_ys are the dependent values, and known_xs are the independent values. For example, =FORECAST(13, B2:B10, A2:A10) returns the predicted y-value when x equals 13, based on the linear trend of the data in those ranges.

What Is the FORECAST Function Used For?

The FORECAST function is a statistical tool that fits a straight line through your data points using the least-squares method, then extends that line to estimate a value beyond your current data. It is commonly used for sales forecasting, inventory planning, budgeting, and any scenario where you want to predict a future outcome based on historical trends. The function assumes a linear relationship between the independent variable (x) and dependent variable (y). For instance, if you have monthly sales figures (y) and the month numbers (x), FORECAST can estimate sales for the next month.

How to Use FORECAST: Step-by-Step

  1. Arrange your data in two columns: one for the independent variable (x, e.g., time) and one for the dependent variable (y, e.g., sales).
  2. Select a cell where you want the forecast result to appear.
  3. Type =FORECAST( and then enter the x-value for which you want a prediction, or click a cell containing that x-value.
  4. Select the range of known y-values, then a comma, then the range of known x-values.
  5. Close the parenthesis and press Enter. The result is the predicted y-value.

For example, with months 1–12 in A2:A13 and sales in B2:B13, to predict sales for month 13: =FORECAST(13, B2:B13, A2:A13). If the trend is linear, this returns a value that fits the line of best fit.

FORECAST vs. FORECAST.LINEAR vs. FORECAST.ETS

Excel has three related functions. FORECAST is the original, still available for compatibility. FORECAST.LINEAR is identical in function and is the recommended replacement in modern Excel versions (Excel 2016 and later). FORECAST.ETS is different: it uses exponential smoothing to handle seasonal or cyclical data, and it requires a timeline with consistent intervals. If your data has seasonality (e.g., higher sales every December), FORECAST.ETS is more accurate. For simple linear trends, use FORECAST or FORECAST.LINEAR.

Choosing the Right Arguments: x, known_ys, known_xs

The x argument is the value you want to predict for—it must be a numeric value or a reference to a cell containing a number. known_ys is the range of dependent values (the y-axis data), and known_xs is the range of independent values (the x-axis data). The two ranges must have the same number of cells, and they must be one-dimensional (a single row or column). If the ranges are different sizes, Excel returns a #N/A error. Also, if any cell in the known ranges contains text or is empty, the function may return an error or ignore the pair, depending on the version.

Common Errors and How to Fix Them

  • #N/A error: Occurs when the known_xs and known_ys ranges are not the same size, or when the x value is non-numeric. Check that both ranges are the same length.
  • #VALUE! error: Happens if any argument is non-numeric or if the known ranges contain text that cannot be coerced to numbers.
  • #DIV/0! error: This appears when the variance of known_xs is zero (all x values are identical). The function cannot fit a line with no variation in x.
  • Misleading results: If your data is not linear, FORECAST will still produce a number, but it may be inaccurate. Always plot your data first to check for a linear trend.

Real-World Example: Sales Forecast

Suppose you run a small business and have monthly sales for January through June: Jan=100, Feb=120, Mar=130, Apr=140, May=160, Jun=170. Put months (1 to 6) in A2:A7 and sales in B2:B7. To predict July (month 7), use =FORECAST(7, B2:B7, A2:A7). The result is approximately 186.7, which is the point on the least-squares regression line when x=7. This shows a positive trend of about 14 units per month.

Limitations and Alternatives

FORECAST only works for linear relationships. If your data follows a curve, consider using TREND for multiple regression or GROWTH for exponential trends. For more advanced forecasting, Excel’s Forecast Sheet feature (under Data > Forecast Sheet) creates a chart with upper and lower confidence bounds using exponential smoothing. Also, note that FORECAST assumes that the x-values are evenly spaced and that the relationship is linear; it does not account for seasonality or external factors.

Frequently Asked Questions

Can I use FORECAST with dates?

Yes, but Excel stores dates as serial numbers. You can use a date directly as the x argument, and the function will work, but the result will be a serial number that you can format as a date. For example, if your x-values are dates, the forecast result will be a date serial number; format the cell as a date to read it.

What is the difference between FORECAST and TREND?

FORECAST returns a single predicted y-value for one new x. TREND can return multiple predicted values for multiple x-values at once, and it also uses linear regression. If you need to forecast several future periods, TREND is more efficient because you can enter an array of new x-values.

Does FORECAST work in Excel for Mac or Google Sheets?

Yes, FORECAST is available in Excel for Mac and in Google Sheets. The syntax is identical. In Google Sheets, the function is also called FORECAST, and it works the same way. However, FORECAST.ETS is not available in Google Sheets.

Why does my FORECAST return a #N/A error?

The most common cause is that the known_ys and known_xs ranges are not the same size. Double-check that both ranges have an equal number of cells. Also, ensure that the x argument is a number, not text. If you have blank cells in the ranges, try removing them or using the FORECAST.ETS function which handles gaps differently.

Can I use FORECAST for non-linear data?

No. FORECAST assumes a straight-line relationship. If your data is curved, the forecast will be wrong. Use polynomial regression (via LINEST) or exponential smoothing (FORECAST.ETS) instead. Always visually inspect a scatter plot of your data before applying FORECAST.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.