Date as X-axis in Excel

0

Excel "latest" version (very recent at least, with the Ribbon interface, 2018).

Fighting with dates to be used as X-axis labels in a chart.

The data below came out of a Pivot table; when selecting it directly in the Pivot table it was not possible to use a "X-Y Scatter" type chart (OK button grayed out on attempt).

When using the Line type - the X-axis Label "Specify interval unit" (Right click the axis, select Format Axis, Select Axis Options, the Labels) has the option to enter a number between 1 and 255 - i.e. not related to date at all. A value of 6 is too low to display ONE date per month, a value of 7 skips months.

So to get further; copy the data to a fresh sheet and make new attempts: Sticking to Scatter type, you can't get Dates for the X-axis, instead the NUMBERS that are used to store dates appears - 2017-01-05 equals 42687.0

How to get past this quirkyness?

-- Example datatable ---
TheDate Value
2017-01-05  31
2017-01-09  33
2017-01-20  36
2017-01-26  17
2017-01-27  19
2017-01-30  30
2017-02-10  67
2017-02-13  34
2017-02-15  1
2017-02-20  20
2017-02-23  13
2017-03-09  32
2017-03-14  31
2017-03-17  34
2017-03-21  22
2017-03-24  36
2017-03-27  34
2017-03-28  33
2017-03-29  3
2017-04-06  52
2017-04-18  36
2017-04-19  25
2017-04-24  32
2017-04-28  34
2017-05-15  34
2017-05-18  24
2017-06-02  35
2017-06-07  32
2017-06-14  33
2017-06-20  35
2017-06-21  34
2017-06-30  5
2017-07-05  34
2017-07-11  36
2017-07-12  36
2017-07-18  26
2017-07-19  31
2017-07-21  34
2017-08-21  35
2017-08-23  31
2017-08-25  34
2017-08-30  19
2017-09-04  32
2017-09-07  14
2017-09-14  36
2017-09-15  66
2017-09-18  1
2017-09-20  35
2017-09-26  63
2017-10-04  15
2017-10-09  35
2017-10-12  17
2017-10-13  35
2017-10-18  35
2017-10-25  33
2017-10-27  47
2017-11-06  24
2017-11-22  25
2017-12-04  36
2017-12-06  11
2017-12-07  35
2017-12-11  71
2017-12-13  33
2017-12-14  22
2017-12-19  34
2017-12-20  13
2017-12-27  31

Hannu

Posted 2018-06-11T12:23:44.777

Reputation: 4 950

You need to format the axis as a date format. If you're getting the internal date value, it's handling the dates properly, it's just a display format issue. My recollection is that a line chart treats the X axis as categories, so if you have irregular intervals between dates, it won't plot values proportionally to time. – fixer1234 – 2018-06-11T22:00:06.890

Answers

0

Make the chart data be external to any Pivot table, and make the type be "Line", ensure that the chart x-axis data is just dates - and the Axis type will show up as date, free to format in a reasonable manner for dates.

Hannu

Posted 2018-06-11T12:23:44.777

Reputation: 4 950

The above might need revision, found this: http://www.informit.com/articles/article.aspx?p=1642672&seqNum=2

– Hannu – 2019-03-26T07:36:03.280