Contact

YEARFRAC in WPS Spreadsheet: Year Fractions with an Explicit Day-Count Basis

Date and Time Intermediate WPS Spreadsheet

Use WPS YEARFRAC for transparent actual/365 date fractions, including a leap-year example and clear limits on other basis modes.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =YEARFRAC(DATE(2025,1,1),DATE(2025,7,1),3) has expected result 0.495890410958904, or 49.5890410958904% when formatted as a percentage.

Syntax and arguments

=YEARFRAC(start_date,end_date,basis)

start_date and end_date are the beginning and ending dates. basis selects the day-count convention. The source prints three arguments and its table identifies a default basis of 0 when omitted; these examples always supply the third argument so that the denominator is visible.

The result is a number of convention years, not a count of completed birthdays or whole calendar years. Multiplying it by an annual amount prorates that amount under the chosen convention, which must match the intended calculation.

Complete worksheet example

Cell Value Meaning
A2 =DATE(2025,1,1) Start
A3 =DATE(2025,7,1) End
A4 3 Actual/365
A5 1200 Hypothetical annual amount

Enter =YEARFRAC(A2,A3,A4) in B2. Ordinary date subtraction gives 181 elapsed days; basis 3 divides by 365, so the independent expected value is 181/365. A separate =A5*B2 gives 595.068493150685, or 595.07 displayed to two decimals. This calculation assumes the amount is meant to be prorated on actual/365; YEARFRAC cannot decide that business rule for you.

Advanced example: a leap year is not always one convention year

=YEARFRAC(DATE(2024,1,1),DATE(2025,1,1),3) has expected result 1.0027397260274, because the interval contains 366 elapsed days and basis 3 still uses 365. The result exceeding one is consistent with actual/365. It does not prove a date-entry error.

For the original 181-day interval, changing basis to 2 gives 181/360, or 0.502777777777778. A basis name is part of the calculation, not merely display formatting. This guide does not infer actual/actual’s multi-year denominator or February-specific 30/360 adjustments from the simple controls.

Errors and troubleshooting

The lesson documents #VALUE! for invalid start or end dates, and #NUM! for basis below 0 or above 4. It says all arguments are truncated to integers. Use date-only inputs and an integer basis rather than relying on time-of-day handling.

Do not treat a value formatted as 49.59% as 49.59 years: the underlying fraction is approximately 0.4959. Use DATE-generated inputs to avoid ambiguity between day/month and month/day text. The source’s date-origin explanation is inconsistent and is not used here. Reversed dates, negative serials and every localized date coercion are outside the verified scope; keep the start before the end in these controls.

Dates and basis

Enter dates with DATE(year,month,day) or references to genuine date cells, rather than locale-dependent text.

The official basis table lists 0 (or omitted) as US NASD 30/360, 1 as actual/actual, 2 as actual/360, 3 as actual/365, and 4 as European 30/360. The examples specify basis explicitly. The names alone do not define every February, month-end or multi-year adjustment; this guide does not generalize its controls to those edge cases.

Evidence and version scope

The official WPS Academy YEARFRAC lesson labels its applicable edition WPS Office For Windows Personal (个人版). The lesson and relevant formula/table illustrations were reviewed on October 19, 2026. This establishes a Chinese first-party documented scope, not English-global, Linux, macOS, mobile or all-edition availability. The numeric build, introduction release and last supported version are not established. The lesson does not identify the function as deprecated.

Examples above are independent mathematical expectations under the stated assumptions. They were not executed in WPS, and no current application screenshot or runtime precision guarantee is supplied. Documentation images establish the written contract, not a new native test. English function tokens and comma separators follow the source; verify localized entry and workbook interchange in the intended client.

  • DATE: Construct unambiguous date inputs.
  • DAYS: Count elapsed calendar days.