I am using Excel 2010 and have a column of data consisting of dates/times like the following (column A):
I am trying to create an XY scatter plot with X-axis labels in which the date is displayed on the first line and the time is displayed on the second line. I have done some searching and found threads such as these that explain how to do it:
however when I try the methods explained in that thread, they don't work. For example, I made a new column, B, containing the following for each row in column A:
Yet when I create a plot using column B as the x-axis values, double-click the x-axis labels, and then choose Number->Custom->"mm-dd-yyyy h:mm:ss AM/PM" for the format of the x-axis labels, the resulting labels are still only on one line and don't even display the correct dates/times (the first visible x-axis label is "01-00-1900 12:00:00 AM".
I then tried to use the CTRL+J trick described in that thread but it didn't work either. To do this I double-clicked the x-axis labels, chose Number->Custom->"mm-dd-yyyy h:mm:ss AM/PM", placed the cursor after the "yyyy" and typed "CTRL+J" (without the quotes), but nothing happened (i.e. it wouldn't let me add a new format after typing "CTRL+J").
I also found this SO thread in which one of the posters said that manually adding "ALT+ENTER" into the cell itself at the appropriate spot (i.e after the yyyy in my case) would automatically propagate to the x-axis labels, but I tried that and it didn't work.
Code:
12/28/2020 11:45:39 AM
I am trying to create an XY scatter plot with X-axis labels in which the date is displayed on the first line and the time is displayed on the second line. I have done some searching and found threads such as these that explain how to do it:
Carriage return in Chart Axis custom format
Hi all, I have a chart with a custom date format for the horizontal axis, inherited from someone else. The custom date format is mmm[]yyy (where the [] is actually a square box, indicating a non displayable character. The effect of that non-displayable character is to push a carriage return...
www.mrexcel.com
however when I try the methods explained in that thread, they don't work. For example, I made a new column, B, containing the following for each row in column A:
Code:
=TEXT(A2,"mm-dd-yyyy
hh:mm:ss AM/PM")
Yet when I create a plot using column B as the x-axis values, double-click the x-axis labels, and then choose Number->Custom->"mm-dd-yyyy h:mm:ss AM/PM" for the format of the x-axis labels, the resulting labels are still only on one line and don't even display the correct dates/times (the first visible x-axis label is "01-00-1900 12:00:00 AM".
I then tried to use the CTRL+J trick described in that thread but it didn't work either. To do this I double-clicked the x-axis labels, chose Number->Custom->"mm-dd-yyyy h:mm:ss AM/PM", placed the cursor after the "yyyy" and typed "CTRL+J" (without the quotes), but nothing happened (i.e. it wouldn't let me add a new format after typing "CTRL+J").
I also found this SO thread in which one of the posters said that manually adding "ALT+ENTER" into the cell itself at the appropriate spot (i.e after the yyyy in my case) would automatically propagate to the x-axis labels, but I tried that and it didn't work.