How to Apply Conditional Formatting Based on a Running Total in Excel
Question details
The user needs to format a row of cells automatically (e.g., coloring them green, yellow, or red) based on whether their cumulative running total meets certain target thresholds.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking continuous data such as daily schedules or monthly inventory, where cells need dynamic color-coding as the cumulative sum changes over time and reaches a specific target.
- Observed behavior
- Cells dynamically change color based on predefined percentage thresholds as the running total updates relative to a fixed target cell.
Ensure your dataset is arranged with a continuous row or column of numerical values to calculate the running total, and designate a specific cell for your target threshold.
Use Formula-Based Conditional Formatting Rules
Apply custom formulas with mixed cell references to calculate a running total dynamically and trigger specific formatting across the row.
By using mixed cell references in your formatting formula, the calculation expands automatically as it moves across the row. You can set up multiple rules to apply different colors, such as green, yellow, and red, depending on how close the cumulative total is to your target value.
Highlight the entire range of cells you want to format. For example, click and drag to select cells M9 through AK9.
Navigate to the Home tab on the ribbon. Click on 'Conditional Formatting' and select 'New Rule' from the dropdown menu.
Choose the option 'Use a formula to determine which cells to format'. Enter a formula that calculates the cumulative sum and compares it to your target, such as =SUM($M9:M9)>=$E9.
Click the 'Format' button, go to the 'Fill' tab, and select your desired color (e.g., Green). Click OK to apply the primary rule.
Repeat the process to add additional rules for different colors (like yellow or red). Multiply your target by a percentage threshold in the formula, for example, =SUM($M9:M9)>=($E9*0.6).

Manage Running Totals Easily with WPS Spreadsheet
WPS Spreadsheet provides powerful and intuitive conditional formatting tools. You can easily apply formula-based rules to track cumulative totals just as you would in Microsoft Excel.
- 1. Open your dataset: Launch WPS Spreadsheet and open your workbook containing the inventory or schedule data.
- 2. Access Conditional Formatting: Select your data row, go to the Home tab, and click on the 'Conditional Formatting' icon.
- 3. Apply formula rules: Select 'New Rule', choose the formula option, and input your running total calculation using mixed references.
- 4. Customize and save: Set your preferred fill colors for the thresholds and click OK to dynamically highlight your data.

Frequently Asked Questions
Why is my conditional formatting applying to the wrong cells?
This is typically caused by incorrect relative or absolute cell references. Ensure the start of your sum range uses an absolute column reference (e.g., $M9) while the end uses a relative reference (e.g., M9) so the range expands properly across the row.
Will the colors update automatically if I change the target inventory value?
Yes. Because the conditional formatting rule references the target cell (like $E9) instead of a hardcoded number, the cell colors will instantly recalculate and update whenever you modify the target value or add new daily data.
How do I prevent multiple formatting rules from conflicting?
Open the Conditional Formatting Rules Manager to view all active rules for your selection. Arrange them in the correct priority order using the up and down arrows. You can also check the 'Stop If True' box on a rule to prevent lower-priority formats from applying once a higher condition is met.




