Asking for Formula Help

ChrisHockley

New Member
Joined
Feb 6, 2017
Messages
41
Guys, I'm always amazed at how much help everyone is here and how experienced those that are here actually are!

I'm trying to round numbers with two decimal places to one decimal place.

Here are the parameters:
1. Anything 3.54 and below should be rounded up or down to the nearest tenth or 0.1
2. Anything between 3.54 and 28.34 should be rounded up or down to the nearest 0.5
3. Anything 28.35 or above should be rounded up or down to the nearest 1.0

Can this be done in one formula so that I don't have to copy and paste multiple versions over thousands of lines?

Thanks in advance!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I've tried the following but anything 28.35 or above returns a 'FALSE'

=IF(D296<=3.54,MROUND(D296,0.1),IF(D296<=28.34,MROUND(D296,0.5),IF(D296>=28.35,MROUND(D296,1))))
 
Upvote 0
Hi Chris,

This seems to work for me:

Excel Formula:
=IF(D296<=3.54,MROUND(D296,0.1),IF(AND(D296>3.54,D296<=28.34),MROUND(D296,0.5),MROUND(D296,1)))/CODE]

The last part is for any number that does fall into any of the previous categories of the formula.
 
Upvote 0
This is the strangest thing... that same cell that is returning the false has 28.35 as the number. =MROUND(D296,0.1) is rounding to 28.3. Clearly it should round to 28.4.

Is there a way to change the rounding parameter to be anything .5, .05, .005 etc should round up and not down?
 
Upvote 0
Not sure as it seems to be working for me. Are the calculation options (Calculations tab in the Formulas ribbon) set to Automatic?
 
Upvote 0
Not sure as it seems to be working for me. Are the calculation options (Calculations tab in the Formulas ribbon) set to Automatic?
Yes it is. For some reason its rounding the 28.35 down to 28.3 instead of up to 28.4 as per normal round rules. I love excel at times.... lol
 
Upvote 0
If you increase the decimal by multiple clicking the left pointing arrow in the Number tab of the Home ribbon what does show?
 
Upvote 0
I think because the limits are to two decimal places we need to round each number by two decimal places like so:

Excel Formula:
=IF(ROUND(D296,2)<=3.54,MROUND(D296,0.1),IF(AND(ROUND(D296,2)>3.54,ROUND(D296,2)<=28.34),MROUND(D296,0.5),IF(ROUND(D296,2)>=28.35,MROUND(D296,1),0)))
 
Upvote 0

Forum statistics

Threads
1,225,490
Messages
6,185,293
Members
453,285
Latest member
Wullay

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