Calculation Issues

Why DATEDIF and Direct Division Produce Different Weekly Totals in WPS Spreadsheets

Aamir Naveed AkramAamir Naveed Akram Nov 13, 2026 870 views

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.

Why DATEDIF and Direct Division Produce Different Weekly Totals in WPS Spreadsheets
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the weekly total cell

Open your workbook in WPS Spreadsheets and click the cell where the weekly total should appear.

2
Enter the DATEDIF formula

Type =DATEDIF(B9,B10,"d")/7 and press Enter. Replace B9 with the start date cell and B10 with the end date cell.

3
Verify the result

Confirm that the cell shows a decimal number of weeks, such as 1.428571, before using it in a prorated calculation.

Use DATEDIF Days Divided by 7 to Keep Fractional Weekly Totals
Formula ready: This method avoids rounding before the weekly total is used, so prorated amounts match the exact 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. 1. Launch WPS Spreadsheets: Open WPS Office and load the workbook that contains the start and end dates.
  2. 2. Choose the weekly total cell: Click the cell where you want the weekly total or prorated amount to appear.
  3. 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. 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.
Supports the same DATEDIF, ROUNDUP, and WEEKNUM formulas as Microsoft ExcelPrevents incorrect prorated amounts by making rounding rules explicitOpens and saves .xlsx workbooks without reformattingFree, lightweight Office suite with a familiar spreadsheet interface
microsoft office alternative - wps office

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.