Formula Errors

Highlight Values Until a Running Total Reaches a Limit in Excel

Camila MilosovichCamila Milosovich Dec 2, 2026 868 views

Question details

Highlight currency values based on whether their running total has reached a specified limit.

Highlight Values Until a Running Total Reaches a Limit in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants conditional formatting to respond when amounts change or rows are added to a currency column.
Observed behavior
Values are highlighted according to their cumulative total and the chosen threshold.
Before you start

Identify the amount range and threshold. The example uses D2:D150 and a limit of 80,000; D1 should be a text header or blank.

Solution 1Recommended

Highlight through the row that reaches the limit

Use this rule when the row that first reaches or exceeds the limit should also be highlighted.

The formula checks the total before the current row, so it includes the row that brings the total to or above 80,000. It assumes amounts are nonnegative; negative values can cause highlighting to resume if the total falls below the limit.

1
Select the amounts

Select D2:D150, making sure D2 is the active cell in the selection.

2
Create a formula rule

Go to Home > Conditional Formatting > New Rule, then select Use a formula to determine which cells to format.

3
Enter the formula

Enter =SUM(D$1:D1)<80000. Replace 80000 with your limit.

4
Choose the highlight

Click Format, choose a color on the Fill tab, and click OK twice.

5
Check the range

Open Home > Conditional Formatting > Manage Rules and check the Applies to range. Extend it when adding rows outside D2:D150, or use an Excel Table and verify that the rule extends to new rows.

Highlight through the row that reaches the limit
Blank cells in the range: The rule can also highlight blank cells before the limit is reached. To highlight numeric cells only, use =AND(ISNUMBER(D2),SUM(D$1:D1)<80000).
WPS Spreadsheet

Highlight a running-total limit in WPS Spreadsheet

Use a formula-based conditional formatting rule in WPS Spreadsheet to highlight amounts through the row that reaches your limit.

  1. 1. Open the workbook: Open your Excel workbook in WPS Spreadsheet and select D2:D150 with D2 as the active cell.
  2. 2. Add a rule: On the Home tab, open Conditional Formatting and choose New Rule, then select the formula-based rule option.
  3. 3. Enter the formula: Enter =AND(ISNUMBER(D2),SUM(D$1:D1)<80000), adjusting the column and limit to match your sheet.
  4. 4. Apply a fill: Choose a fill color in the formatting options and confirm the rule. Check its applied range when adding rows.
Highlight amounts based on a running-total thresholdOpen and edit Microsoft Excel XLS and XLSX filesUse familiar spreadsheet menus and formulasGet WPS Office free
microsoft office alternative - wps office

Frequently Asked Questions

Does the formula highlight the row that exceeds the limit?

Yes. =SUM(D$1:D1)<80000 checks the total before the current row, so the row that first reaches or exceeds 80,000 is highlighted.

How can I exclude the row that reaches the limit?

Create a formula-based rule for D2:D150 using =AND(ISNUMBER(D2),SUM($D$2:D2)<80000). Use <= instead of < if an exact total of 80,000 should remain highlighted.

Will the formatting apply to new rows?

Rows added within the applied range are covered. For rows outside it, open Home > Conditional Formatting > Manage Rules and extend the Applies to range. If you use an Excel Table, verify that the rule extends to new rows.

Why are blank cells highlighted?

The previous-total formula can be true for blank cells. Add a numeric check with =AND(ISNUMBER(D2),SUM(D$1:D1)<80000) to highlight only cells containing numbers.