Round up to whole hours

G

Guest

My formula calculates the time 2 hours from now and I need it to round up to
the next hour:

=NOW()+TIME(2,0,0)

I tried a few things but they didn't work!
 
R

Ron Rosenfeld

My formula calculates the time 2 hours from now and I need it to round up to
the next hour:

=NOW()+TIME(2,0,0)

I tried a few things but they didn't work!

The CEILING function should do what you want.

Try this:

=CEILING(NOW()+TIME(2,,),TIME(1,,))


--ron
 
P

Peo Sjoblom

And if one doesn't want to include all days since 1900 one could use

=CEILING(MOD(NOW(),1)+TIME(2,,),TIME(1,,))

or even

=CEILING(MOD(NOW(),1)+2/24,1/24)

--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey
 
G

Guest

Problem solved, didn't seem to need to use the mod bit, but will keep in mind
just in case!

Thanks guys!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top