Fix the #NUM! Error in an Excel Exponential Trendline
Question details
The user needs to calculate an exponential trendline without a #NUM! error when Excel dates are used as the independent variable.

- 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.
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.
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.
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.
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.
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.
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.

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. Open the spreadsheet: Open WPS Spreadsheets and use File > Open to select your workbook.
- 2. Add relative days: If dates are in A1:A5, enter =A1-$A$1+1 in C1 and fill it down through C5.
- 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. 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.

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.




