PPRuNe Forums - View Single Post - Can you round up time? - Excel
View Single Post
Old 11th January 2005 | 13:14
  #4 (permalink)  
Jhieminga
Community Builder
20 Countries Visited
20 Anniversary
 
Joined: Mar 2002
: CPL
Posts: 3,392
Likes: 325
From: near an aeroplane
Aahhh, thanks for that Llademos as that gave me the tip needed to crack it!

You don't have to hide any colums, just paste this rather lengthy formula in a cell: =IF((MINUTE(I269)>30);(DAY(I269)+TIME(HOUR(I269)+1;0;0));(DA Y(I269)+TIME(HOUR(I269);0;0)))

I've used I269 as a reference cell here, replace this (five times) with the one you need.
The first statement looks if the minutes part of the time are more than 30. Insert other number if needed (0 for example if you want to always round up).
The second section gives the rounded up time, the third section gives a rounded down time, always to the nearest hour.
Format the cells as [hh]:mm to keep it looking right



Edited to correct for hours over 24!
Jhieminga is offline