How to Calculate What Fraction of a Year Was a Specific Period in Excel
Question details
The user wants to find out what percentage or fraction of the year 2017 was taken up by Ramadan (May 26 to June 24).

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Calculating the duration of an event in days and determining its percentage relative to a full calendar year.
- Observed behavior
- The user needs the correct formulas to subtract start dates from end dates and divide by the total days in the year to get a percentage.
Ensure your start and end dates are properly recognized as date formats in your spreadsheet so the mathematical formulas calculate the days correctly.
Using Basic Subtraction and Division Formulas
You can manually calculate the total days of the event and divide it by the total days in the year (365) using basic cell references.
This method involves calculating the exact number of days between two dates inclusively, and then dividing that number by the total days in a standard year.
Type the Start Date (May 26, 2017) in cell B2 and the End Date (June 24, 2017) in cell B3.
In cell B5, type the formula =B3-B2+1 and press Enter. Adding 1 ensures both the start and end dates are included in the count, giving you a total of 30 days.
Type the total number of days in the year 2017 (which is 365) into cell C5.
In cell C6, type the formula =B5/C5 and press Enter. This will divide 30 by 365, giving a decimal result of approximately 0.08219.
Select cell C6, go to the Home tab, and click the '%' icon to format the decimal as a percentage (8.2%).

Using the YEARFRAC Function
A faster way to calculate the fraction of a year between two dates is by using the built-in YEARFRAC function.
Easily Calculate Date Fractions in WPS Spreadsheet
WPS Spreadsheet offers powerful date and time functions, including basic arithmetic and the YEARFRAC function, to help you calculate time durations effortlessly.
- 1. Open a Spreadsheet: Launch WPS Office and open a new or existing Spreadsheet document.
- 2. Input Your Data: Enter your event's start date and end date in two separate cells.
- 3. Apply the Formula: Use the formula =(End_Date - Start_Date + 1) / 365 to instantly find the fraction of the year.
- 4. Format the Cell: Click the '%' button on the Home tab to format your result for easy reading.

Frequently Asked Questions
Why do I need to add 1 when subtracting dates?
Subtracting the start date from the end date gives the strict difference between them. Adding 1 ensures both the starting day and the ending day are included in the total duration count (an inclusive calculation).
How do I calculate the fraction for a leap year?
In a leap year, you divide the total event days by 366 instead of 365. Alternatively, if you use the YEARFRAC function with the basis argument set to 1, the spreadsheet automatically accounts for leap years.
How do I change the decimal result to a percentage?
Select the cell containing the decimal result (e.g., 0.08219), navigate to the Home tab on your ribbon, and click the Percentage (%) icon. You can also adjust the precision by using the Increase Decimal or Decrease Decimal buttons next to it.




