The number of days to birthday calculation shown in Figure 6.8 does not check
for the leap year. Add a checking for leap year in the calculations by looking at
the current year and deciding whether it is a leap year or not.
Example 6.5 Time Sheet Calculations
In this example, we will work on a problem using time-related functions. We are asked
to set up a worksheet that will calculate the number of hours worked by an employee
and calculate the salary due to the employee. The employee’s salary is calculated by the
regular hourly rate for the first 40 hours. Hours worked beyond 40 hours get paid at an
overtime rate of
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.