Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ROUNDUP Time?

Status
Not open for further replies.

uklaffin

ISP
Oct 8, 2001
4
GB
Hi,

Does anybody know how to 'roundup' time and convert it to a number?

eg. I need 00:01:26 (hh:mm:ss)to be rounded up to 2

I haven't used Excel for years!

Thanks.
 
Time in Excel is in a fraction of a day:
6:00 AM = .25
12:00 PM = .5
et cetera

So to round your time, you can multiply the time by 24 and then use your favorite rounding function.

For example, if cell A1 contains your time "00:01:26 (hh:mm:ss)" then you can type this in cell B1:

=roundup(A1*24,0)

and you'll get the value of 2. If you want the number to still be in time format, divide your result by 24:

=roundup(A1*24,0)/24

and you'll get the value of 2:00 AM.
 
Thanks euskadi.

I still can't get the formula to work if I use =roundup(A1*24,0) all it returns is 1

I've tried it on the following (hh:mm:ss) examples:

00:02:22
00:03:07
00:25:29
00:01:29

Any other ideas?
 
Excellent!

=ROUNDUP(A1*1440,0)/1440 works, don't suppose you know how to convert it to a number eg:

Change 01:01:32 (hh:mm:ss) to 63 (with the roundup included)

Thanks for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top