Exclude Unwanted Dates from an Excel Online Line Chart X-Axis
Question details
Show only the intended dates on an Excel Online line chart's horizontal axis.

- Product
- Excel Online
- Device & OS
- not provided
- Scenario
- A user creates a line chart from dated data and wants to omit dates such as weekends.
- Observed behavior
- The chart displays unwanted dates on the horizontal axis, including dates that may not be present in the source data.
Check whether the unwanted dates are actual rows in the chart's source data or gaps added by a continuous date axis. Make sure the dates you want to plot are in chronological order.
Use text labels to show only the dates in the source data
Use this method when Excel adds dates, such as weekends, that are not in the source data.
A date axis can fill calendar gaps between data points. Text labels make the chart treat the supplied dates as categories instead.
Add a column next to the values you want to chart. If the first date is in A2, enter =TEXT(A2,"mmm d, yyyy") in the first label cell and fill the formula down.
Select the text-label column and the corresponding value column, including their headers. Exclude the original date column from the selection.
Choose Insert > Line Chart and select a line chart style. Check that the horizontal axis uses the text labels and shows only the selected dates.

Hide source rows for dates you do not want to plot
Use this method when the unwanted dates are present in the worksheet rows included in the chart.
Change the horizontal axis to a text axis in desktop Excel
Use desktop Excel when you can open the workbook there and want to change the existing chart's axis type.
Create a line chart with only the dates you select in WPS Spreadsheet
Use text labels in WPS Spreadsheet to create a line chart that treats your selected dates as categories instead of filling calendar gaps.
- 1. Open your workbook: Open WPS Spreadsheet and choose Open to select your Excel workbook.
- 2. Make text date labels: In a column next to your chart values, enter =TEXT(A2,"mmm d, yyyy"), replacing A2 with the first date cell. Fill the formula down for the remaining dates.
- 3. Select labels and values: Select the text-label column and the corresponding value column, including their headers.
- 4. Insert a line chart: Choose Insert > Chart, select a line chart, and check that the horizontal axis shows the selected text labels.

Frequently Asked Questions
Why does my chart show weekends when my data has no weekend rows?
A date axis can display calendar dates between the first and last data points. Use text date labels or change the axis to Text axis in desktop Excel's Format Axis pane.
Will hiding rows remove dates that Excel adds automatically?
No. Hiding rows can exclude data stored in those rows, but it does not remove dates inserted to fill gaps on a date axis. Use text labels or a text axis for those gaps.
Why are hidden rows still plotted in my chart?
The chart may be set to show data in hidden rows or columns. Open the workbook in desktop Excel and check the chart's Select Data > Hidden and Empty Cells settings.
Does a text axis preserve the actual time gaps between dates?
No. A text axis spaces categories evenly. Keep a date axis if the distance between points needs to reflect elapsed time.




