Santa's Elf Time Card, Part 2: Checking It Twice

Before the North Pole pays out a single cup of cocoa, every time card gets a second look.

Santa's elves aren't paid in dollars. They're paid in cocoa: two cups for every hour worked. But a time card that says 10:30 doesn't tell the payroll elf how many cups to pour. For that, you need decimal hours in Excel: 10.5 hours instead of 10 hours and 30 minutes.

Then comes the part Santa is famous for: checking it twice. With six elves, four departments, and the busiest week of the year, a few mistakes are bound to sneak in. A forgotten clock-out. A 6:00 PM typed as 11:00 PM. An elf entered twice by two different supervisors. Any of them can turn into a payroll problem that's hard to fix after the fact.

Follow along with the free December practice workbook. Open the Checking It Twice sheet. Hours Worked is already filled in using the overnight-shift formula from Part 1: The Night Shift. Three mistakes are hiding in the list.

1. Convert Time to Decimal Hours in Excel

Getting decimal hours in Excel starts with something from Part 1: Excel stores a time as a fraction of a day. So 10:30 is really 0.4375 of a day. Say it in English: a day has 24 hours, so multiply the fraction of a day by 24.

=F10*24

  1. Click G10. The formula is already there as an example, and the result is 10.50.
  2. Copy it down through G34.
  3. If you build this in your own workbook and see something like 12:00 AM, Excel copied the time format along with the formula. Press Ctrl 1, choose Number, and set 2 decimal places.

Outcome: With decimal hours in Excel, every shift is now an ordinary number, ready to multiply by a pay rate, add up, or send to a payroll system.

2. Calculate the Pay

Decimal hours in Excel are easy to multiply. The cocoa rate lives in its own cell, B8, so Santa can change it without touching a single formula. Say it in English: pay equals decimal hours times the rate.

=G10*$B$8

  1. Click H10 and look at the example formula.
  2. Notice the dollar signs in $B$8. They lock the reference, so it still points to B8 when you copy the formula down.
  3. Copy the formula down through H34.
  4. Test it: change B8 to 3 and watch every Cocoa Pay cell update. Then change it back to 2.

Outcome: When the rate changes, every paycheck updates at once, with no formulas to rewrite.

Tip: While typing a formula, click the cell you want (B8) and press the F4 key to add the dollar signs automatically. That makes the cell reference absolute ($B$8). Press F4 a second time to make only the row part absolute (B$8), a third time to make only the column part absolute ($B8), and a fourth time to make all parts relative again (B8).

3. Prepare for an Audit Using Column I

Before you type a single formula, decide what "something's wrong" means. For Santa's workshop, there are three questions to ask about every row. You will display their answers in column I.

  • Is the clock-out missing? Then display "Missing clock-out."
  • Otherwise, is the shift longer than 12 hours? Then display "Over 12 hours."
  • Otherwise, is this elf listed more than once on the same day? Then display "Two departments?"
  • If none of those, display "OK."

The order matters, because decimal hours in Excel can look perfectly normal even when the data behind them is wrong. Look at Pip Hollyhock on December 22, on row 18. There's no clock-out, yet Hours Worked shows 17:00. Excel treats the blank cell as midnight, so the formula figures Pip worked from 7:00 AM until midnight. Checking for a missing clock-out first identifies misleading hours worked.

Outcome: You know exactly what you're checking for before you start, which makes the formula much easier to build and to explain to someone else.

4. Enter the Mega-Formula, One Step at a Time

The check in column I needs a formula with multiple functions working together: three IFs and a COUNTIFS. Many people call this a mega-formula. The best way to create a mega-formula is gradually. Enter the first part and make sure the formula doesn't return an error. Then add the second part, again making sure it returns no errors. Continue until all parts have been entered.

Start in I10 with the first question:

=IF(E10="","Missing clock-out","OK")

Next, replace "OK" with the second question. The new IF is surrounding the rest of the formula's answer:

=IF(E10="","Missing clock-out",IF(G10>12,"Over 12 hours","OK"))

For the third question, COUNTIFS counts how many rows have this elf's name and this date. If the count is more than 1, the elf is listed twice:

=IF(E10="","Missing clock-out",IF(G10>12,"Over 12 hours",IF(COUNTIFS($A$10:$A$34,A10,$C$10:$C$34,C10)>1,"Two departments?","OK")))

  1. Type the full formula in I10 and press Enter.
  2. Copy it down through I34.
  3. Scan the Check column. Most rows say OK. Four rows don't.

Outcome: Excel checks every row the same way, every time, so nothing depends on a tired pair of eyes at the end of a long week.

Tip: Many Excel users type their formulas in a program like Notepad or Notepad++ first. There they can edit, copy, and paste freely without Excel complaining that the formula has invalid syntax. When the formula is ready, paste it into the cell.

5. Filter, Fix, and Check It Twice

On a list of 25 rows, the flags are easy to spot. On a list of 2,500, let a filter find them for you.

First, though, there's a design problem to fix, and it's one you'll run into in real workbooks too. Excel's filter treats every row that touches the table as part of it. On this sheet, the cocoa rate in row 8 sits right above the headings in row 9, so Ctrl Shift L would treat the title and instructions in rows 1 to 8 as part of the table. A blank row between the table and everything above it solves the problem.

  1. Right-click the row number 9 and choose Insert. A blank row now separates the cocoa rate from the headings, which move down to row 10. Your formulas adjust automatically.
  2. Click any cell in the table and press Ctrl Shift L to turn on filters.
  3. Click the filter arrow on the Check column and uncheck OK. Only the problem rows remain.
  4. Fix each one, using what you learned from the elves and their supervisors:
    • You contacted Pip Hollyhock, and she said she forgot to clock out on December 22. Her actual clock-out time was 6:00 PM. Type 6:00 PM in her Clock Out cell.
    • Clove Frostmantle's supervisor says the 11:00 PM clock-out on December 23 was a typo for 6:00 PM. Change it to 6:00 PM.
    • Bramble Gingersnap's two supervisors compared notes. On December 21, Bramble worked in Sleigh Maintenance, not Toy Assembly. Right-click the row number of the Toy Assembly row and choose Delete. (This is why two rows were flagged for one mistake.)
  5. Press Ctrl Shift L again to turn off the filters. Every Check cell should now say OK. That's checking it twice.

Outcome: Payroll goes out right the first time, with no awkward corrections in January.

Quick Reference

In plain English Actual Excel formula
Decimal hours equal Hours Worked times 24=F10*24
Pay equals decimal hours times the rate in B8 (F4 adds the $ signs)=G10*$B$8
If the clock-out is blank, display "Missing clock-out"IF(E10="","Missing clock-out", ...)
Otherwise, if the shift is longer than 12 hours, display "Over 12 hours"IF(G10>12,"Over 12 hours", ...)
Otherwise, if this elf is listed more than once on this date, display "Two departments?"IF(COUNTIFS($A$10:$A$34,A10,$C$10:$C$34,C10)>1,"Two departments?","OK")

To turn filters on or off, press Ctrl Shift L. Leave a blank row between the table and anything above it.

For more detail, see Microsoft's COUNTIFS function and Add or subtract time in Excel.

Nice List, Not Naughty

Converting to decimal hours in Excel takes one multiplication. Catching mistakes takes one well-planned mega-formula. Decimal hours in Excel plus a good audit turn a pile of time cards into a payroll you can trust, at the North Pole or in your own office.

👻 Have a database that needs checking twice?

Spreadsheets aren't the only place mistakes hide. Ghost Tracker v2 is a free, point-and-click tool that scans a Microsoft Access database for orphan records and missing relationships. It's read-only and never changes your data.

Get Ghost Tracker v2

Want help building a payroll check like this for your team? Reach out to us and let us know how we can help you.