![]() |
Round up to whole hours
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! |
Round up to whole hours
On Wed, 28 Jun 2006 18:10:01 -0700, ivory_kitten
wrote: 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 |
Round up to whole hours
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 "Ron Rosenfeld" wrote in message ... On Wed, 28 Jun 2006 18:10:01 -0700, ivory_kitten wrote: 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 |
Round up to whole hours
Problem solved, didn't seem to need to use the mod bit, but will keep in mind
just in case! Thanks guys! "Peo Sjoblom" wrote: 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 "Ron Rosenfeld" wrote in message ... On Wed, 28 Jun 2006 18:10:01 -0700, ivory_kitten wrote: 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 |
All times are GMT +1. The time now is 10:57 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com