Excel Formula for Monthly Project Costs Between Start and End Dates
Question details
Calculate an equal monthly share of a project cost during the project's active calendar months and return zero outside that period.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains a total project cost, start date, end date, and dates representing the months to calculate.
- Observed behavior
- Each calendar month that overlaps the project period should receive an equal share of the total cost; other months should show zero.
Enter the total cost in B1, the start date in B2, and the end date in B3. Make sure B2, B3, and the month dates in column D are valid Excel dates, and that the end date is not earlier than the start date.
Divide the Project Cost Across Active Calendar Months
Use this formula when every calendar month overlapping the project dates should receive the same share of the total cost.
The formula counts inclusive calendar months, including partial start and end months. It does not prorate the cost by the number of active days.
In D2, enter a date within the month you want to test. Enter additional month dates in D3 and subsequent rows if needed.
Select E2 and enter =IF(AND(EOMONTH(D2,0)>=$B$2,EOMONTH(D2,-1)+1<=$B$3),$B$1/((YEAR($B$3)-YEAR($B$2))*12+MONTH($B$3)-MONTH($B$2)+1),0).
Drag the fill handle from E2 down beside the remaining dates in column D. The dollar signs keep the project cost and dates fixed.

Calculate Monthly Project Costs in WPS Spreadsheets
Use the same calendar-month formula in WPS Spreadsheets to distribute a project cost across its active months and show zero outside the date range.
- 1. Open a spreadsheet: Open WPS Spreadsheets and create a workbook or open your existing project-cost file.
- 2. Enter the project data: Enter the total cost in B1, the start date in B2, the end date in B3, and a date for each month in column D.
- 3. Add the formula: Select E2 and enter =IF(AND(EOMONTH(D2,0)>=$B$2,EOMONTH(D2,-1)+1<=$B$3),$B$1/((YEAR($B$3)-YEAR($B$2))*12+MONTH($B$3)-MONTH($B$2)+1),0).
- 4. Copy the formula: Drag the fill handle from E2 down alongside the month dates, then use Save As to save the workbook in XLSX format if needed.

Frequently Asked Questions
Does the formula include partial months?
Yes. Any calendar month that overlaps the start-to-end date range receives a full equal share, even if the project is active for only part of that month.
Can D2 contain the first day of the month even if the project starts later?
Yes. The formula checks whether the whole calendar month containing D2 overlaps the project period, so D2 can be any valid date in that month.
Why not use DATEDIF with the "m" argument to count months?
DATEDIF with "m" counts completed months, which can differ from the number of calendar months touched by the project. The formula above counts calendar months using YEAR and MONTH.
How do I show the monthly cost as currency?
Select the results in column E, then use Home > Number Format in Excel and choose Currency or Accounting.




