Rounding Negative time to the nearest minute in Excel

Demtro73

New Member
Joined
Mar 14, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Good Day Group.

I have searched the internet and this forum and have seen some questions and responses similar to my question but none that have an answer I can use, so I am hoping somebody can help.

Spreadsheet configuration -
I am using the 1904 date system so my spreadsheet will display negative time.
formatting for calculated time cells us h:mm
formatting for time cells is Time using 1:30 PM formatting, but the data in the cell has seconds, that are hidden.

I currently use MROUND to round to the nearest minute up or down
Example below

This works most of the time, however there are times when a negative number appears, and when I try to MROUND the negative number when adding it to a positive number I get the #NUM Error. I understand why I get this error.

I know that I probably need to use ROUND instead of MROUND, however all the similar issues I have found are for rounding to hours and not minutes.

I have tried to manipulate the ROUND formula to calculate rounding for seconds but cannot seem to figure it out. I created a table to show the data.

A1-E2 show it working properly.

A5-E5 shows the #NUM Error since MROUND does not work with negative times

I need the formulas in C5 and E5 to round up or down to the nearest minute when there are negative numbers in the calculated cells.

Any help is greatly appreciated. I am on a work computer and cannot install anything, otherwise i would have used the Mini-sheet feature.

ABCDE
1ScheduleEnterA-BTotal TimeC+D
28:00:32 AM7:45:00 AM=MROUND(A2-B2,"0:01") result is 0:160:38=MROUND(C2+D2,"0:01") result is 0:54
3
4ScheduleEnterA-BTotal TimeC+D
58:00:32 AM8:07:00 AM=MROUND(A5-B5,"0:01") result is #NUM 0:38=MROUND(C5+D5,"0:01") result is #NUM
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Why not take the ABS of the subtraction to ensure it's positive?
 
Upvote 0
Why not take the ABS of the subtraction to ensure it's positive?
Great Question...but I need to know if the number is positive or negative, and I need to use that number in a mathematical calculation farther down the road. I considered seeing if i could format the cells to identify the negative number as a red number similar to accounting, however that wont work when I have to take -0:15 and add 0:38 to get the final overall time from A-Z.

I do appreciate the feedback.
 
Upvote 0
Great Question...but I need to know if the number is positive or negative, and I need to use that number in a mathematical calculation farther down the road. I considered seeing if i could format the cells to identify the negative number as a red number similar to accounting, however that wont work when I have to take -0:15 and add 0:38 to get the final overall time from A-Z.

I do appreciate the feedback.
Formatting the cells doesn't resolve the #NUM error. If you need the negative calculation down the road then just do the subtraction again without the ABS. As for the purpose of column C, just take ABS()?
 
Upvote 0
Perhaps:

=-INT(-(A5-B5)*1440)/1440

Book2
ABC
58:00:32 AM8:07:00 AM-0:06:00
68:00:32 AM7:45:00 AM0:16:00
Sheet1
Cell Formulas
RangeFormula
C5:C6C5=-INT(-(A5-B5)*1440)/1440
 
Upvote 0

Forum statistics

Threads
1,223,936
Messages
6,175,500
Members
452,650
Latest member
Tinfish

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