Chart & Visualization Issues

How to Format Excel Category Axis Gridlines by Time

Kushani NimanthikaKushani Nimanthika Oct 15, 2026 871 views

Question details

The user wants to format the horizontal category axis in an Excel chart to display major gridlines at day boundaries and minor gridlines at hourly intervals.

How to Format Excel Category Axis Gridlines by Time
Product
Excel
Device & OS
not provided
Scenario
Creating a detailed time-series chart where data needs to be visually separated by specific hour or minute intervals, but the default axis settings do not offer units smaller than a day.
Observed behavior
Standard category and date axes only provide 'Days', 'Months', or 'Years' as base units. Formatting the source data to a time format changes the label appearance but does not unlock hourly or minute axis units.
Before you start

Verify your current chart type. Line charts and Column charts use category (or date) axes for the horizontal axis, which inherently lack support for time-based fractional intervals like hours or minutes.

Solution 1Recommended

Change the Chart Type to XY (Scatter) to Use a Value Axis

Converting your chart to an XY Scatter chart transforms the horizontal axis from a category axis into a value axis, allowing you to use decimals that correspond to specific hours or minutes.

Spreadsheet applications store dates and times as serial numbers, where 1 whole number equals 1 day (24 hours). Therefore, time can be expressed as a fraction of a day. For example, 1 hour is 1/24 (0.0416667) and 12 hours is 0.5.

By switching to a Scatter chart, you can input these precise decimal values into the axis Bounds and Units settings to force the gridlines to appear at hourly marks.

1
Change Chart Type

Right-click your existing chart and select 'Change Chart Type' from the context menu. Choose 'X Y (Scatter)' and pick a sub-type that connects data points with lines.

2
Open Axis Formatting Options

Right-click the horizontal (X) axis at the bottom of the chart and choose 'Format Axis'.

3
Set Major Units for Days

In the Format Axis pane under Axis Options, locate the 'Units' section and set the 'Major' unit to 1.0. This ensures major gridlines appear at the start of each new day.

4
Set Minor Units for Hours

Set the 'Minor' unit to 0.0416667 (which represents 1 divided by 24). This will generate minor gridlines exactly at one-hour intervals.

Change the Chart Type to XY (Scatter) to Use a Value Axis
Calculating Custom Time Intervals: You can calculate any time interval by dividing the desired hours by 24. For 6-hour gridlines, use 0.25. For 30-minute intervals, divide 30 by 1440 (0.0208333).
Professional Spreadsheet Software

Easily Customize Complex Charts in WPS Spreadsheet

WPS Spreadsheet offers powerful and intuitive charting features that let you seamlessly handle advanced data visualization tasks, including managing value axes and custom time intervals.

  1. 1. Open Your Data: Launch WPS Spreadsheet and open your existing workbook containing the time-series data.
  2. 2. Insert a Scatter Chart: Highlight your data, navigate to the 'Insert' tab, click 'Chart', and select an 'XY (Scatter)' line chart.
  3. 3. Access Axis Options: Double-click the horizontal axis to instantly open the formatting pane on the right.
  4. 4. Apply Decimal Units: Under 'Axis Options', input decimal representations of time (like 0.0416 for hourly) into the Major or Minor unit fields.
Fully compatible with Microsoft Excel (.xlsx) formats, ensuring your custom charts display perfectly.Intuitive right-side properties pane for instantly formatting axis bounds, units, and custom gridlines.Free to download and use, providing an exceptionally lightweight alternative for daily office tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does changing the source date format not affect my chart axis units?

Changing the number format of the source cells only alters how the data is visually labeled (e.g., displaying hours and minutes). It does not change the underlying axis type. A category or date axis is hardcoded to use days, months, or years as its smallest structural boundaries.

Can I format the X-axis labels to show both date and time?

Yes. Right-click the horizontal axis, select 'Format Axis', and scroll down to the 'Number' section. Choose 'Custom' from the category list and input a format code such as 'mm/dd/yyyy hh:mm AM/PM' to display detailed date and time stamps.

How do I calculate the axis unit for 15-minute gridlines?

Because 1 whole unit equals 24 hours (or 1440 minutes), you calculate a 15-minute interval by dividing 15 by 1440. This gives you 0.01041667. Enter this decimal value into your axis Major or Minor unit box while using a Scatter chart.