DAYSINYEAR


Returns the number of days in a year.

Syntax:

DAYSINYEAR(date)

returns the number of days in the year in which date lies.

Example:

DAYSINYEAR("2012-02-14")

returns 366, the number of days in 2012 (2012 is a leap year).


Application:

Employee Vacation Accrual


A company, "Globex Corp.," offers a vacation benefit where employees accrue a certain number of vacation hours per day. The daily accrual rate is calculated by dividing the total annual vacation hours by the number of days in the year.


  • Policy:
    • Annual vacation hours for all full-time employees: 120 hours.
    • Daily accrual rate = Annual hours / Days in the year.


Here is a table showing the calculation for a few employees over a couple of years. We will simulate the DAYSINYEAR function to show how the daily accrual rate changes.

Employee ID

Employee Name

Year

DAYSINYEAR(Year)

Daily Accrual Rate (Hours)

A
B
C
D
E
1
101
Jane Doe
1/15/2024
366
0.327868852
2
102
John Smith
7/20/2024
366
0.327868852
3
101
Jane Doe
1/15/2025
365
0.328767123
4
102
John Smith
7/20/2025
365
0.328767123

Explanation of the Table:

  • For the dates in 2024 (01/15/2024 and 07/20/2024), the DAYSINYEAR function would return 366 because 2024 is a leap year. The daily accrual rate is therefore 120 hours divided by 366 days, resulting in approximately 0.327868 hours per day.
  • For the dates in 2025 (01/15/2025 and 07/20/2025), the DAYSINYEAR function would return 365 because 2025 is a common year. The daily accrual rate is slightly higher, at 120 hours divided by 365 days, resulting in approximately 0.328767 hours per day.




This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof