I'm getting errors in overtime calculation in Numbers

I have my schedule and I have made a cell with the total hours worked in this case it is cell G2, I am trying to make a formula where if I work more than 40 hours it will automatically calculate the overtime. This is what I have. I keep getting this error: "Durations can’t be compared to other data types." I am very lost and any help would be greatly appreciated.


IF(DUR2HOURS(G2>40),(40×15)+(DUR2HOURS(G2−40)×22.5),DUR2HOURS(G2×15))


40 is hours worked

15 is rate of pay

22.5 is overtime pay




[Re-Titled by Moderator]

Original Title: Overtime calculation in Numbers

MacBook Air, macOS 15.6

Posted on Aug 20, 2025 4:14 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 20, 2025 4:50 AM

If G2 has a duration value in it,

=LET(hrs,DUR2HOURS(G2),MIN(hrs,40)×15+MAX(0,hrs−40)×22.5)

or

=MIN(DUR2HOURS(G2),40)×15+MAX(0,DUR2HOURS(G2)−40)×22.5

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

I'm getting errors in overtime calculation in Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.