Roundup To nearest hour

HI not sure If I being stupid.

I’m trying to round up duration to the nearest hour. In google sheets, I can do it with =ROUNDUP(C2/(1/24),0)*(1/24).

I just can’t figure out how to do it in Appsheet.

https://community.appsheet.com/t/faq-rounding-datetime-duration-and-time-values/31686/7

3 Likes

Hi @Grant_Stead

The problem I have with that formula is it always add an hour: for example

Start 8:00:00 Finish 9:30:00 becomes duration 02:30:00
Start 8:00:00 Finish 9:00:00 becomes duration 02:00:00

What I need is

Start 8:00:00 Finish 9:30:00 becomes duration 02:00:00
Start 8:00:00 Finish 9:00:00 becomes duration 01:00:00

Thanks

Blake

I believe you may wish to share some more examples of desired results. Based on the example shared , you may wish to try the following

“000:00:00” + CEILING(TOTALHOURS([EndTime] - [StartTime]))

Your requirement is to calculate duration but just incase you are looking also for next hour time, @Steve had shared an excellent expression

3 Likes

Thank you very much @Suvrutt_Gurjar. That works a treat I tried a similar Ceiling equation but I didn’t think about adding “00:00:00”+.

Thank you :smiley:

Blakes

2 Likes

You are welcome @BlakeHammond. Good to know it works the way you want.

3 Likes