How to Calculate Past-Due Hours for an Excel Stacked Bar Chart
Question details
The user wants to calculate and visualize consumed past-due hours on a weekly stacked bar chart without showing negative values when remaining hours drop to zero.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking weekly workload and capacity in a project management or time-tracking spreadsheet.
- Observed behavior
- The user needs a formula that prevents negative values from appearing on the stacked bar chart when capacity exceeds consumed hours.
Ensure your spreadsheet has clear, separate columns for weekly capacity and consumed hours before building the stacked bar chart.
Use the MAX Function to Calculate Past-Due Hours
Using the MAX formula ensures your chart only displays positive past-due hours and defaults to zero when capacity meets or exceeds the workload.
When building a stacked bar chart, negative values can distort the visual representation of your data by extending bars below the baseline. By wrapping your subtraction formula in a MAX function, Excel will output a zero instead of a negative number if no past-due hours remain.
Create columns for 'Weekly Capacity', 'Consumed Hours', and 'Past-Due Hours' in your spreadsheet.
In the 'Past-Due Hours' column, enter the formula =MAX(0, [Consumed Hours] - [Weekly Capacity]). Replace the bracketed text with your actual cell references (e.g., =MAX(0, C2 - B2)).
Ensure you have separate data series calculated for standard capacity, consumed hours, and the newly calculated past-due hours.
Select your data range, navigate to the 'Insert' tab, click on the 'Column or Bar Chart' icon, and choose 'Stacked Column' or 'Stacked Bar' to visualize the weekly data.
Create Project Management Charts in WPS Spreadsheet
WPS Spreadsheet provides powerful charting tools and over 400 built-in formulas, including the MAX function, to help you track weekly capacity and past-due hours with ease.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your time-tracking workbook.
- 2. Input the MAX formula: Use =MAX(0, Consumed-Capacity) in your past-due column to calculate non-negative hours.
- 3. Select your data: Highlight the cells containing your weeks, capacity, and calculated past-due hours.
- 4. Insert the Chart: Go to the Insert tab on the top ribbon, click Chart, and select the Stacked Bar chart type to visualize your workload.

Frequently Asked Questions
Why does my Excel stacked bar chart show negative bars?
Negative bars appear when your calculation results in a value less than zero. Using the =MAX(0, formula) function forces any negative results to display as zero, keeping all stacked bars above the baseline axis.
Can I hide zero values on my stacked bar chart?
Yes. You can format the data labels to hide zeros by right-clicking the labels, selecting 'Format Data Labels', and applying a custom number format such as '0;;;' to prevent zeroes from cluttering your chart.
How do I change the color of the past-due hours in the chart?
Click directly on the past-due hours series within your stacked bar chart to select it, right-click, choose 'Format Data Series', and pick a distinct fill color (like red) from the Fill & Line options to make it stand out.
Is the MAX function compatible between Excel and WPS Spreadsheet?
Yes, the MAX function works exactly the same in both Microsoft Excel and WPS Spreadsheet, meaning your time-tracking files and charts will function seamlessly across both programs.




