The book: files and exercises · Lesson 24 of 24

Lesson 24 exercises: tracking hours worked

Five exercises on the Bayview Hotel front desk hours tracker, with lesson24.xlsx completed as in the lesson: a night shift, the number of shifts, a pay example, a deleted row and the week of a shift that crosses midnight.

Lesson 24. Project: tracking hours worked

Use lesson24.xlsx completed as in the lesson, and before each exercise put the original data back.

Files: lesson24.xlsx · solutions: lesson24-solutions.xlsx.

In the exercises with a sheet, type the formula in the fx bar and click Check: the sheet works it out the way Excel does, with commas between the arguments (semicolons work too), and also tries it with other data, to see whether it still works when the data changes. In the other exercises, you work in Excel with the lesson's file and type the result here.

At the end of the page you'll find the lesson's Bonus challenge: one more exercise, whose answer isn't in the book. You check it only here.

Exercise 1

Outside the table, type a shift in three empty cells: from 11:30 PM to 7:15 AM with a 30-minute break. How many decimal hours is that, worked out with MOD and ROUND?
In cell M4
fx
Show the answer

For example, with the start in J4, the end in K4 and the break in L4: =ROUND((MOD(K4-J4,1)-L4)*24,2) = 7.25 hours (7:45 minus 30 minutes = 7:15).

Exercise 2

Use a formula to count how many shifts Marcus Reed worked in November.
Type the formula in the empty cell J4
fx
Show the answer

=COUNTIF(Shifts[Employee],"Marcus Reed") = 21 shifts.

Exercise 3

Only as a calculation example, not as a rule: with an hourly rate of $18.00 and overtime paid at 1.5 times the rate, how much would Emily Carter earn, before deductions, in November? (Regular hours = the month's hours minus the month's overtime.)
Emily Carter's regular hours
Example gross pay
Show the answer

Hours in the month 164.50, overtime 4.50, regular hours 160.00. 160 × $18.00 = $2,880.00; 4.50 × $18.00 × 1.5 = $121.50; in total $3,001.50.

Exercise 4

Priya's shift on Sunday, November 29, is canceled: delete the row from the table. How many hours and how much overtime does she have in week 48 then? What happens to the cell's color?
Priya's hours in week 48
Priya's overtime in week 48
What happens to the cell's color?
Show the answer

Priya's week 48: from 46:00 to 40:00 hours (40.00 as a decimal), overtime 0.00: the cell is no longer red, because 0 isn't greater than 0.

Exercise 5

Without Excel: Marcus works from Sunday, November 29, at 10:00 PM to Monday, November 30, at 7:00 AM. In which week does the sheet count this shift? And why doesn't =[@End]-[@Start] work for it?
In which week does the sheet count this shift?
Why doesn't =[@End]-[@Start] work for this shift?
Show the answer

In week 48, the week of Sunday, November 29, the day it starts. =[@End]-[@Start] gives 7:00 AM minus 10:00 PM, a negative number, and Excel shows #####: you need MOD(...,1).

Bonus challenge

The answer isn't in the book: you check it only here.

How many hours in total was the front desk staffed in November, adding up the shifts of all three people? In an empty cell, add up the Hours column of the Shifts table (original data). If you see a small number, the cell's format is to blame.
Total hours
Show the answer

=SUM(Shifts[Hours]) with the format [h]:mm shows 444:30, that is 444.50 decimal hours: 164.50 hours for Emily, 168.00 for Marcus and 112.00 for Priya. With the format h:mm, the same cell shows 12:30, because the hours start again from zero every 24 hours. With the General format, you see the number of days, a little more than 18. To fix the format: Ctrl+1, Custom category, type [h]:mm in the Type box and click OK. You can also add up the Decimal column, =SUM(Shifts[Decimal]), which gives 444.5 right away.