Apple launches Apple Store app in India

The Apple Store app provides customers with the most personalized way to shop for Apple’s innovative lineup of products and services. Learn more >

You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Function in numpers that shows a different result depending on the conditions

Good evening and happy new year. I would like your help for a result in Numpers.

I have a table with my weekly work schedule. The normal working hours are 8 hours so I subtract the longest hour from the shortest and I have the result which is 8 hours. However, there are also days when the hours become 10-12 so we have overtime. These appear in another cell. And in this case I subtract the total number of working hours with the number 8. The problem starts when I have a day off where the cell with the overtime writes -8 while it should show 0 or nothing. Can someone tell me how to do it?

Posted on Jan 17, 2025 8:37 AM

Reply
3 replies

Jan 17, 2025 10:58 PM in response to Giannisgen

Hi Giannisgen,


Testing for days off



Formula in D2 (and fill down) is IF(OR(B2="",C2=""),DURATION(,,0,0),C2−B2)

If a cell in column B or C is blank (=""), then insert a Duration of ,,0,0 (no weeks, no days, zero hours, zero minutes)

Else insert C-B.



Formula in E2 (and fill down) is IF(D2≤DURATION(,,0,0),DURATION(,,0),D2−"8h")


Please call back with questions.

Regards,

Ian.

Jan 17, 2025 4:47 PM in response to Giannisgen

In this other cell where you calculate the overtime, use the function IF.


For instance, if your calculation is (A1-8) where cell A1 is where you enter the work hours, the function should be:

IF(A1-8<0,0,A1-8)


So if (A1-8) is lower than 0, 0 will be returned, otherwise the calculation (A1-8) will be returned.

Function in numpers that shows a different result depending on the conditions

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