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.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

I want to calculating the chargeable hours on Number.


Hi please help me I have spent 5 days on this already.

So I have enter the "Time On-site" in duration ...h...m

What I want to do is calculating the chargeable hours.

the rule is:

  • if anything less than 1 hour is 1 hour. For example: 0h11m = 1 chargeable hour
  • If the hour > 0 then anything more than 10m will be the hour + 1 and anything less than 10m will be the hour. For example: 1h1m = 1 chargeable hour. 2h22m = 3 chargeable hours. Then I want to sum it all up.


Thank you so much if you help me hixx


[Re-Titled By Moderator]

MacBook Pro 14″, macOS 14.6

Posted on Aug 28, 2024 12:55 AM

Reply
2 replies

Aug 28, 2024 7:47 AM in response to alextrantryingtolikeNumbers



I added a new row to make the formula easier. You can hide that row after it is all set up.


B2 =STRIPDURATION(B1)×24

B3 =IFS(B2=0,0,B2<1,1,ROUND(MOD(B2,1)×60,0)≥10,INT(B2)+1,TRUE,INT(B2))

fill across with both to column J

K3 =SUM(B3:J3)

For row 3, fix the formatting so it isn't 3 decimals. Make them all auto. That was a mistake in my screenshot.


For hours>0, you stated that if min<10 then it is just the hours and if min>10 then it is hours+1 but you did not say what to do if min=10 exactly. The formula given above says if min>=10 then hours+1.


Note that, probably due to computer math not being perfect (base 10 decimal numbers translated to Base 2 for the computer sometimes have extremely small errors), STRIPDURATION*24 will turn hours + 10 minutes into the decimal equivalent of hours + 10.0000000000002 minutes. The ROUND function in the row 3 formula rounds it back to an integer number of minutes.

Aug 30, 2024 9:08 PM in response to alextrantryingtolikeNumbers

This (I think) gives same results with possibly slightly easier to follow formula:






In B2. filled right to col J:


=DUR2HOURS(B1)


This simply converts the Duration to decimal hours.


In B3, filled right to col J:


=IF(AND(B2>0,B2≤1),1,IF(MOD(B2,1)>10/60,INT(B2)+1,INT(B2)))



Explanation:


The IF(AND(B2>0,B2≤1),1 handles the case where the time spent on site is greater than 0 but less than or equal to an hour.


The second IF nested within the first handles the cases where the time spent is greater than an hour (or is 0).


The IF(MOD(B2,1)>10/60 checks if more than 10 minutes past the hour.


If yes, get the number of whole hours with INT and add 1.


If no, get the number of whole hours with INT but don't add 1.


SG





I want to calculating the chargeable hours on Number.

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