Formula Errors

Fix the #NUM! Error in an Excel Exponential Trendline

Steve KSteve K Dec 2, 2026 869 views

Question details

The user needs to calculate an exponential trendline without a #NUM! error when Excel dates are used as the independent variable.

Fix the #NUM! Error in an Excel Exponential Trendline
Product
Microsoft Excel
Device & OS
not provided
Scenario
An exponential trendline formula uses LINEST and EXP with dates as x-values and measured values as y-values.
Observed behavior
The formula can return #NUM! because large Excel date serial numbers produce an intercept that causes EXP to overflow.
Before you start

Check that the dates are actual Excel date values, not text, and that every y-value is greater than zero. LN cannot calculate the logarithm of zero or a negative number.

Solution 1Recommended

Use relative days in the exponential trendline formula

Replace large date serial numbers with days relative to the first date to avoid an overflowing intercept calculation.

Excel stores dates as serial numbers. Using relative days shifts the x-axis without changing the elapsed time between observations. The resulting intercept is relative to that new axis, not to Excel's date zero.

1
Create relative day numbers

With dates in A1:A5, enter =A1-$A$1+1 in C1 and fill the formula down through C5. Consecutive daily dates become 1 through 5; gaps between dates are preserved.

2
Calculate the intercept

With positive y-values in B1:B5, enter =EXP(INDEX(LINEST(LN(B1:B5),C1:C5),1,2)) in an empty cell. In older Excel versions, confirm the formula with Ctrl+Shift+Enter if required.

3
Calculate the exponent

In another empty cell, enter =INDEX(LINEST(LN(B1:B5),C1:C5),1,1). Use the results in y = intercept × e^(exponent × x), where x is the relative day number.

4
Check the model fit

Select the data and use Insert > Scatter to create a chart. Add an exponential trendline and select the option to display its R-squared value on the chart.

Use relative days in the exponential trendline formula
Interpret the example carefully: For the original sample using relative days 1 through 5, the intercept is approximately 5.83983 and the exponent is approximately -0.24204. Its R² is about 0.3822, indicating a weak fit; fixing the error does not make the model reliable.
Work with exponential trendlines

Calculate an exponential trendline in WPS Spreadsheets

Use relative day numbers and spreadsheet formulas in WPS Spreadsheets to calculate an exponential trendline without relying on large date serials.

  1. 1. Open the spreadsheet: Open WPS Spreadsheets and use File > Open to select your workbook.
  2. 2. Add relative days: If dates are in A1:A5, enter =A1-$A$1+1 in C1 and fill it down through C5.
  3. 3. Calculate the intercept: With positive y-values in B1:B5, enter =EXP(INDEX(LINEST(LN(B1:B5),C1:C5),1,2)) in an empty cell. Confirm it as an array formula if your version requires it.
  4. 4. Calculate the exponent: Enter =INDEX(LINEST(LN(B1:B5),C1:C5),1,1) in another empty cell and use both results with the relative day numbers.
Use relative days to reduce the risk of an overflowing trendline interceptOpen and save Microsoft Excel XLSX filesCalculate trendline coefficients with familiar spreadsheet functionsWork with spreadsheet data in a familiar interface
QA img-9

Frequently Asked Questions

Why do Excel dates cause a #NUM! error in this formula?

Excel dates are large serial numbers. LINEST may calculate a large log-scale intercept at date serial zero, and applying EXP to that intercept can exceed Excel's numeric range. Use relative days instead.

What if my dates are not consecutive?

Use =A1-$A$1+1 in a helper column and fill it down. This keeps the actual number of days between dates rather than assigning consecutive numbers to unevenly spaced observations.

Can I use zero or negative y-values in an exponential trendline?

No. The LINEST approach uses LN on the y-values, and LN requires values greater than zero. Review those values or choose a different model.

Does removing the #NUM! error mean the trendline is a good fit?

No. Display the trendline's R-squared value on a scatter chart to assess the fit. The original sample's R² is approximately 0.3822, so its exponential trendline may not be reliable.