How to Display a Fixed Cost for a Selected Number of Years in Excel
Question details
The user wants to conditionally display an annual fixed cost across multiple columns based on a specified number of years.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating a financial model or policy schedule where certain costs apply only for a set number of years.
- Observed behavior
- Needs a formula to compare the current column's year number against the allowed duration and return the cost only if within that period.
Ensure your spreadsheet is set up with policy years in a continuous row (e.g., E19 to N19) and that you have dedicated cells for the applicable year count and the fixed cost.
Use the IF Function to Conditionally Apply Costs
Use a logical IF formula with absolute references to compare the policy year against the allowed duration.
By utilizing Excel's IF function, you can create a dynamic schedule that checks if the current year column falls within the allowed policy duration. If it does, the formula calculates the cost; if not, it returns a default base amount or zero.
Click on the first cell where the cost should be displayed, directly under your first policy-year header.
Type the formula =IF($E$9>=E19,1000+$D$9,1000) into the formula bar. Replace $E$9 with the cell containing your applicable year count, E19 with the cell containing the current year header, and $D$9 with your fixed cost.
Press Enter to calculate the result. Then, click and drag the fill handle at the bottom-right corner of the cell across the adjacent year columns to copy the formula.

Easily Manage Financial Formulas with WPS Office
WPS Spreadsheet provides full support for logical functions like IF, making it easy to build dynamic financial models and policy schedules seamlessly.
- 1. Open your workbook: Launch WPS Spreadsheet and open your financial or policy workbook.
- 2. Enter the logical formula: Select the target cell and type your =IF() formula using absolute and relative cell references.
- 3. Fill across columns: Use the drag-to-fill feature to instantly apply the calculation across all your policy years.

Frequently Asked Questions
Why is my formula returning an error when copied across columns?
This usually happens if you forget to use absolute references (like $E$9). Without the dollar signs, the cell references shift as you drag the formula, causing calculation errors.
Can I use this formula if my base amount changes?
Yes, you can replace the static '1000' in the formula with a cell reference that contains your base amount. Just remember to make it an absolute reference (e.g., $B$2) if it applies to all years.
How do I stop the cost from displaying entirely after the selected years?
Modify the 'value_if_false' part of the IF formula. For example, use =IF($E$9>=E19, $D$9, 0) to display zero, or =IF($E$9>=E19, $D$9, "") to display a blank cell after the period ends.




