Why DATEDIF and Direct Division Produce Different Weekly Totals in WPS Spreadsheets
Question details
The user wants to understand why calculations that convert DATEDIF elapsed days to weeks and calculations that divide dates directly produce different weekly totals, and how to choose the correct formula.

- Product
- WPS Spreadsheets
- Device & OS
- not provided
- Scenario
- The user is creating a date-based weekly total or prorated amount in a WPS Spreadsheets workbook.
- Observed behavior
- DATEDIF returns elapsed days; dividing by 7 yields fractional weeks, and rounding changes the divisor and the prorated result.
Open your workbook in WPS Spreadsheets and identify the start-date and end-date cells. Confirm whether your weekly total should treat both dates as inclusive and whether partial weeks must round up, down, or remain fractional.
Use DATEDIF Days Divided by 7 to Keep Fractional Weekly Totals
Use this method when you need the exact elapsed time in weeks and a fractional week is acceptable for prorating.
DATEDIF returns whole elapsed days between two dates. Dividing by 7 preserves the fractional week, so prorated amounts are not rounded prematurely.
Open your workbook in WPS Spreadsheets and click the cell where the weekly total should appear.
Type =DATEDIF(B9,B10,"d")/7 and press Enter. Replace B9 with the start date cell and B10 with the end date cell.
Confirm that the cell shows a decimal number of weeks, such as 1.428571, before using it in a prorated calculation.

Round Up Any Partial Week to a Full Week with ROUNDUP
Use this method when your business rule counts every started week as one full week, such as for billing or attendance.
Count Calendar Weeks Inclusively with WEEKNUM
Use this alternative when the weekly total should follow the calendar week from the start week through the final week, independent of elapsed days.
Calculate Weekly Totals Correctly in WPS Spreadsheets
Use WPS Spreadsheets to build weekly totals with DATEDIF, ROUNDUP, or WEEKNUM and control whether partial weeks remain fractional or round up. The formulas behave like Microsoft Excel, so you can apply the same date logic in a familiar worksheet environment and keep your .xlsx workbooks compatible.
- 1. Launch WPS Spreadsheets: Open WPS Office and load the workbook that contains the start and end dates.
- 2. Choose the weekly total cell: Click the cell where you want the weekly total or prorated amount to appear.
- 3. Enter the appropriate formula: Type =DATEDIF(B9,B10,"d")/7 for exact fractional weeks or =ROUNDUP(DATEDIF(B9,B10,"d")/7,0) for partial weeks counted as full weeks.
- 4. Apply number formatting and verify: Use the Number Format menu on the Home tab to set decimal places, then compare the result with a known date range to confirm it matches the business rule.

Frequently Asked Questions
Why does =DATEDIF(B9,B10,"d")/7 return a decimal in WPS Spreadsheets?
Because DATEDIF returns the number of elapsed whole days, and dividing those days by 7 converts the result into weeks. Unless the date range is an exact multiple of 7 days, the weekly total will be fractional.
How do I force every partial week to count as one full week?
Use =ROUNDUP(DATEDIF(B9,B10,"d")/7,0). This rounds any fractional week upward, so a range of 8 days becomes 2 weeks.
When should I use WEEKNUM instead of DATEDIF?
Use WEEKNUM when the weekly total should be based on calendar week numbers rather than elapsed 7-day periods. For dates in the same year, =WEEKNUM(B10,21)-WEEKNUM(B9,21)+1 counts the start week through the final week inclusively.
Does WPS Spreadsheets support the DATEDIF function?
Yes. WPS Spreadsheets supports DATEDIF and accepts the same unit arguments, including "d" for days, so you can use Excel-compatible date formulas without changing your workbook.
How do I make the start and end dates inclusive in a weekly total?
Add 1 to the DATEDIF day result before dividing or rounding. For example, use =ROUNDUP((DATEDIF(B9,B10,"d")+1)/7,0) when both the start date and end date must be counted.




