How to Round Numbers

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
In my code, I run into values of a variable (tdur) representing duration (in hours) .

These are some examples:

0.53
1.53
2.11
1.06
1.32
2.64
0.26

I would like to round these to the nearest 30 minutes. So, with these example:

0.5
1.5
2.0
1.0
1.5
3.0
0.5

I thought it was more simple than it is.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
in the real excel anything over 1 is a day, so you will need to use 24 to get it into a position that it will look like hours, giving you always less than 1, then you could add CEILING. Are you always rounding up or down or allow it to work to natural limits
 
Upvote 0
a​
b​
c​
2​
0.53​
0.5​
b2: =mround(a2, 0.5)
3​
1.53​
1.5​
4​
2.11​
2.0​
5​
1.06​
1.0​
6​
1.32​
1.5​
7​
2.64​
2.5​
8​
0.26​
0.5​
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

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