How to Create an Excel Running Balance Formula with Min and Max Limits
Question details
The user needs to calculate a daily running balance that enforces both a minimum limit to prevent negative values and a maximum limit to cap the capacity.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking a daily resource balance (e.g., water tank capacity) where fixed withdrawals are made, negative values are impossible, and excess amounts beyond the maximum capacity are discarded.
- Observed behavior
- Requires a reliable nested formula to automatically maintain the calculated balance strictly within predefined 0 to 50,000 boundaries.
Ensure your spreadsheet data is organized into clear columns for previous balances, daily inflows, and fixed withdrawals so the formula can correctly reference each variable.
Use Nested MIN and MAX Functions to Bound the Balance
By nesting the MAX and MIN functions together, you can establish both a rigid floor (zero) and a firm ceiling (maximum capacity) for your running balance calculations in a single step.
The MAX function evaluates the math against 0, ensuring the total never drops into negative numbers. The MIN function then takes that output and evaluates it against your highest allowed capacity, immediately discarding any excess.
Create dedicated columns for 'Previous Balance' (e.g., cell B2), 'Daily Inflow' (e.g., cell C3), and 'Current Balance' (e.g., cell D3).
In your Current Balance cell, type =MAX(B2+C3-100, 0). Replace '100' with your actual fixed withdrawal amount. This ensures the result is at least 0.
Modify the formula by wrapping it inside a MIN function to cap the maximum value. Update it to read: =MIN(MAX(B2+C3-100, 0), 50000). Replace '50000' with your specific tank or inventory limit.
Press Enter to view your capped balance. Click the fill handle at the bottom-right corner of the cell and drag it downwards to automatically apply this bounded calculation to the remaining rows.
Track Complex Running Balances Easily in WPS Spreadsheet
WPS Office provides a powerful, free Spreadsheet tool that fully supports advanced nested formulas like MIN and MAX, making it incredibly easy to track inventory, tank limits, or financial balances.
- 1. Open WPS Spreadsheet: Launch WPS Office on your device and create a new blank spreadsheet or open your existing balance tracking document.
- 2. Enter the Bounded Formula: Select the cell for your current balance and input =MIN(MAX(previous_cell+inflow_cell-outflow, 0), max_limit).
- 3. Auto-fill the Column: Press Enter to evaluate the formula. Double-click the cell's fill handle in the lower-right corner to automatically copy the bounding logic down your entire tracking column.

Frequently Asked Questions
Can I use dynamic cell references instead of fixed limits for the MIN and MAX functions?
Yes. Instead of typing fixed numbers like 100 or 50,000 directly into the formula, you can refer to specific cells that contain these limits (e.g., =MIN(MAX(B2+C3-$E$1, 0), $E$2)). Make sure to use absolute references (using the $ symbol) so the limit cells remain constant when you copy the formula down.
Why is my running balance returning a negative number instead of zero?
If your balance is returning a negative number, check your nesting order. Ensure that the MAX function is evaluating the calculation against 0 (e.g., MAX(calculation, 0)) and that this MAX function is nested inside the MIN function. Reversing them will break the logic.
Does this formula work the same way in WPS Office as it does in Microsoft Excel?
Absolutely. Both WPS Spreadsheet and Microsoft Excel use the exact same syntax and calculation logic for the MIN and MAX functions, ensuring complete cross-compatibility for your running balance spreadsheets.




