Often you may want to display a date and time on the x-axis of a chart in Excel:

The following step-by-step example shows how to do so in practice.
Step 1: Enter the Data
First, let’s enter the following dataset into Excel:

Step 2: Insert Scatter Plot with Straight Lines
Next, highlight the values in the range A2:B9.
Then click the Insert tab along the top ribbon, then click the icon called Scatter with Straight Lines and Markers within the Charts group.

The following chart will automatically appear:

By default, Excel makes each label on the x-axis horizontal.
However, this causes the labels to overlap in some areas and makes it difficult to read.
Step 3: Rotate Axis Labels
To make the axis labels easier to read, first double click any of the values on the x-axis.
In the Format Axis panel that appears, click the icon called Size & Properties and type -45 in the box titled Custom angle:

The x-axis labels will be rotated at a 45 degree angle to make them easier to read:

Notice that the labels are much easier to read now.
Step 4: Customize the Chart (Optional)
Lastly, feel free to add axis labels, add a chart title, remove the gridlines, and customize the colors to make the chart look exactly how you’d like:

Our chart with a date and time on the x-axis is now complete.
Additional Resources
The following tutorials explain how to perform other common tasks in Excel:
How to Add Labels to Scatterplot Points in Excel
How to Change Axis Scales in Excel Plots
How to Add a Vertical Line to Charts in Excel
Doesn’t work. My data is exactly as in the example, but Excel is still not respecting the date/time column and just plotting the y-axis values against 1, 2, 3, 4…etc.
Hi Jacob…If Excel is not recognizing your date/time column correctly and is plotting your Y-axis values against simple index numbers (1, 2, 3, …), here are some troubleshooting steps to fix the issue:
### **1. Ensure the Date/Time Column is Recognized as a Date Format**
– Select your **date/time column**.
– Go to **Format Cells (Ctrl + 1)** > **Number** tab.
– Choose **Date** or **Custom**, and set the format to `mm/dd/yyyy hh:mm:ss` or another appropriate format.
– If the data doesn’t change its format, Excel might be treating it as text. Continue to Step 2.
### **2. Convert Text to Date/Time Format**
– Select the date/time column.
– Go to **Data** > **Text to Columns**.
– Choose **Delimited** > Next > Next.
– Under **Column Data Format**, select **Date** and choose the correct format (e.g., `MDY`, `DMY`).
– Click **Finish**.
### **3. Set the X-Axis to Recognize the Date Format**
– Click on your chart to select it.
– Right-click the **X-axis** > **Format Axis**.
– In the **Axis Options** pane:
– Under **Axis Type**, ensure that **Automatically select based on data** is checked.
– If it’s still incorrect, manually select **Date axis**.
– Under **Number**, set the category to **Date** and choose an appropriate date/time format.
### **4. Remove Blank Cells or Non-Date Values**
– If there are **blank** or **non-date** values in the date column, Excel may not recognize it correctly.
– Check for any missing data and fill it in or remove those rows.
### **5. Recreate the Chart with Correct Data Selection**
– If the issue persists, try **creating a new chart** from scratch:
1. Select your **date/time** and **Y-axis** values.
2. Go to **Insert** > **Scatter Plot (XY Scatter)** or **Line Chart**.
3. Ensure Excel is using the date/time column for the X-axis.
Let me know if this helps or if you need further assistance! 🚀