Rounding time problems formula

gjgj

New Member
Joined
Jan 10, 2011
Messages
15
Hi,

I want to round different time entries but I'm having problems with the seconds.
If a time is less than 1 min, I want to round up to 1 min.
But if the time is more than one min, I want to round up or down depending on the seconds (if <29sec then round down to lower min, if more than 30 then round up).
EG
00:01:10 = 00:01:00
00:01:30 = 00:02:00
00:00:30 = 00:01:00
00:00:29 = 00:01:00

I have this formula below which works for most but it rounds down to 0 when the time is less than 30s. I tried several IF combinations etc but I can't get anything to work, any easy fixes out there I can add to the below (or something totally new)?

Code:
=HOUR(L260)*60+MINUTE(L260) + IF(SECOND(L260)>=30,1,0

Thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi, does this fit the specification?

=MAX("00:01:00",MROUND(L260,"00:01:00"))
 
Upvote 0
all results returned are 0 now...

Hi, I don't think it's possible for that formula to return a zero - make sure you have formatted the cells that contain the formula as time.


Excel 2013
LM
26000:01:1000:01:00
26100:01:3000:02:00
26200:00:3000:01:00
26300:00:2900:01:00
Sheet4
Cell Formulas
RangeFormula
M260=MAX("00:01:00",MROUND(L260,"00:01:00"))
 
Upvote 0
Sorry, they were formatted as Number (was using it outside existing table) - working now, thanks FormR!
 
Upvote 0

Forum statistics

Threads
1,223,953
Messages
6,175,598
Members
452,658
Latest member
GStorm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top