Hi
I use this formula to calculate time IF(H4=””,””,H4-G4) the result in this instance is 1:59 I want to roundup to 2:00 I won’t bore you with the reason why unless it becomes necessary.
Thanks in advance
Braddy
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Roundup ?
Hi Braddy
So, you want to round up to the nearest hour?
In Excel, all time is stored in cells in decimal units of ‘days’, irrespective of your chosen display format.
So your calc (H4-G4) gives a result in ‘days’ but displays in your chosen format.
We first convert your answer in days to give an answer in decimal hours:
(H4-G4)*24 e.g. 1.965432
Then use
=ROUNDUP((H4-G4)*24,0) to round up to the nearest hour.
Then convert back into days for the cell value:
=ROUNDUP((H4-G4)*24,0)/24
zeddy
As an alternative, I think
IF(H4=””,””,CEILING(H4-G4,TIME(0,30,0))
would do it.
Fascinating. We have a timesheet that calculates the hours worked with =sum(I6-D6)-(F6-E6)-(H6-G6) and puts the results in the J6 cell. D6 being the time they first arrive, I6 being the time they leave for the day, and the other four are for two in and out times during the day for lunch or appointments.
The trouble we’ve had was rounding up the real time to the quarter hour. At the end of the day J6 might equal 7:54. We’ve left it up to the user to translate that into a useful number rounded to the nearest quarter. This number rounds up to 8. If it had been 7:52, the user rounds down to 7.75.
Your use of CEILING and TIME is the closest I’ve been to solving how to have the timesheet do that rounding instead of the user. Is there a way to do that, rounding to nearly 15 minute increment?
Here’s the formula we came up with:
=ROUND((SUM(H12-C12)-(E12-D12)-(G12-F12))*96,0)/96
C12 is when the person arrives, H12 is when they leave at the end of the day, and the others are for two breaks like for lunch or an appointment. The formula rounds to the nearly 15 minutes and then converts the time into a usable number for our bookkeeper.
Without the help I get here we’d still be doing this the hard way. Thank you!
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications