Numbers: SLOPE/INTERCEPT vs. chart trend line slope/intercept

macos 26 numbers functions SLOPE and INTERCEPT do not duplicate chart slope and intercept.


I have a chart that plots values vs dates. The chart shows the trend line and gives the values for slope and intercept. When I use SLOPE and INTERCEPT on the exact same data, I get something different. Can someone explain why the difference? Or can someone detect what I have done wrong?



The data shown in the image is truncated. I can provide the full table of data if necessary.


When I test the values in the Date column using ISDATE, it returns true.


The chart I have been using for three years and I have been manually typing the slope and intercept values to a separate table to track their history. I was hoping to try to automate it somewhat. But SLOPE and INTERCEPT don't look like they can do the job ... unless I'm doing something wrong.


Also, I have used the slope and intercept from the chart to determine deviations of each data point from the trend line, and I have been successful. So, I think the values shown on the chart are good ones.


Mac mini M4 pro 2024

macOS 26.5.1

Numbers 15.2.1


If anyone can help, many thanks,

Tom C.


[Edited by Moderator]

Mac mini (M4 Pro, 2024)

Posted on Jun 22, 2026 3:17 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 24, 2026 6:20 AM

Yes, the better question is why does a chart give a slope and intercept when the X data is dates. It really makes no sense. What is 1.468E-6 multplied by a date? Excel uses numbers to represent dates, where 1 is Jan 1, 1900, so a slope and intercept in Excel kind of makes sense; it is showing it as a date but it is actually just a number. Numbers might be doing something similar in the background for the chart but it doesn't let us in on it. If it was a line (category) chart, Numbers would replace your X data with 1,2,3,4,etc. internally and calculate the slope and intercept using that. It will do the same in a scatter chart if your X data is letters and such.


Best I can tell for the scatter chart is it uses milliseconds for each day. Each day is 86400 milliseconds so each day is 86400 larger then the previous one. But I can't quite figure out how it picks a starting date; it is not the same each time.


If you need a slope and intercept, create a column of numbers where 0 is the row with your start date (or choose a different start date) and the other rows are calculated as date - start date. In other words, each row has the number of days since the start date. It'll take more calculation to keep converting to/from numbers to dates but it is easy math.



6 replies
Question marked as Top-ranking reply

Jun 24, 2026 6:20 AM in response to Tom Cloutier

Yes, the better question is why does a chart give a slope and intercept when the X data is dates. It really makes no sense. What is 1.468E-6 multplied by a date? Excel uses numbers to represent dates, where 1 is Jan 1, 1900, so a slope and intercept in Excel kind of makes sense; it is showing it as a date but it is actually just a number. Numbers might be doing something similar in the background for the chart but it doesn't let us in on it. If it was a line (category) chart, Numbers would replace your X data with 1,2,3,4,etc. internally and calculate the slope and intercept using that. It will do the same in a scatter chart if your X data is letters and such.


Best I can tell for the scatter chart is it uses milliseconds for each day. Each day is 86400 milliseconds so each day is 86400 larger then the previous one. But I can't quite figure out how it picks a starting date; it is not the same each time.


If you need a slope and intercept, create a column of numbers where 0 is the row with your start date (or choose a different start date) and the other rows are calculated as date - start date. In other words, each row has the number of days since the start date. It'll take more calculation to keep converting to/from numbers to dates but it is easy math.



Jun 24, 2026 7:58 PM in response to Tom Cloutier

To Badunit:


Chart makes perfect sense when you know that dates for the X-axis are seconds since January 1, 2001 at 12 AM. I can duplicate every point on the trend line using the chart slope and intercept. Despite the fact that the values are displayed as dates, the underlying units are seconds (not milliseconds as I mentioned previously) since 2001-JAN-01 (not 1900-JAN-01) and that would result in a slope value that is tiny as shown on the example chart. And, yes, chart handles all the mumbo-jumbo behind the scenes.


It's just unfortunate that the functions SLOPE and INTERCEPT don't behave the same as chart when working with dates.


I agree, time is just a number. But different systems/platforms interpret that number differently. Chart uses seconds since 2001-JAN-01. Outside chart, it seems to be milliseconds since 1900-JAN-01. I believe the old unix is milliseconds, but using 1970-JAN-01 as its reference point. It would be nice if all systems and platforms interpreted that time number the same way.

Jun 25, 2026 11:39 AM in response to Badunit

The prior chart was made with dates.


Below is how I duplicated the trend line so I could determine deviations from actual counts.



In my case it is seconds that is required to duplicate the trend line. If chart in Numbers has floating reference points and/or various scales for times and dates, that's most unfortunate.


The interval between data points is generally a week or 604800 seconds. You can see that the trend line increases by 1 between the first two data points. (The difference is NOT 1 between every pair of data points.) So the slope would be 1/604800 or 1.653e-6 between those two points. That's why the slope is such a tiny number. And that's why I believe that the slope/intercept on the scatter chart are correct while the functions SLOPE and INTERCEPT do not duplicate what chart does for some (unknown to me) reason.

Jun 22, 2026 11:28 AM in response to Camelot

Thanks, Camelot, for your reply. I overlooked the restriction on input for INTERCEPT ... my mistake.


That begs the question: The slope and intercept from the chart both use date as the independent variable. In that case, intercept works perfectly fine with dates. Why are the functions different? SLOPE does not return the value noted on the chart; INTERCEPT doesn't work at all; yet, chart has absolutely no problem.


My objective in trying to duplicate the calculation of slope and intercept determined by the chart is simply to save me having to read numbers off the chart and type them into the separate table for tracking purposes. It is considerably quicker and definitely more accurate to copy and paste the values into the other table. At my age, my vision and dyslexia slow me down a lot. Just yesterday, I mistyped a number which I happened to catch. God only knows how many errors I have missed. I can certainly continue as I have in the past ... and I will have to because of this discrepancy.


The issue is there is a difference in how chart determine slope and intercept values and how the functions SLOPE and INTERCEPT determine those same values. Why? It seems to me that linear regression ought have one definition and chart and the two functions should take the same inputs and produce the same slope and intercept.


I don't know if this is pertinent to INTERCEPT, but I had previously determined (with Community help) that scatter chart converts dates to milliseconds (a number) from January 1, 2001, at 0h 0m 0s 0ms and determines the slope and intercept. It seems that functions SLOPE and INTERCEPT could do the same so that dates could be valid inputs to the functions and yield results consistent with scatter chart.

Numbers: SLOPE/INTERCEPT vs. chart trend line slope/intercept

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.