Achieving MROUNDUP

Peter Davison

Active Member
Joined
Jun 4, 2020
Messages
435
Office Version
  1. 365
Platform
  1. Windows
I am using MROUND to do a simple rounding up or down on a variable cell "T6" amount.
This is fine until the rest of the formula delivers a result of Zero.
My variable cell in "T6" is 0.25.
So based on MROUND it will result at Zero.
What I want is for everything to round up and down unless the result is 0 then I want it to round up to the variable in "T6" 0.25.
This is my original formula -

MROUND(IF($AG$6="N",IF($S12="","",IF($AF12=$AF$9,$S$10*$Y12,IF($AF12=$AF$10,"",IF($S$10*$Y12<$AC12,$AC12,IF($S$10*$Y12>$AD12,$AD12,IF($S$10*$Y12<$T$6,$T$6,$S$10*$Y12)))))),IF($S12="","",IF($AF12=$AF$9,$S$10*$Y12,IF($AF12=$AF$10,"",IF($S$10*$Y12<$AC12,$AC12,IF($S$10*$Y12>$AD12,$AD12,IF($S$10*$Y12<$T$6,$T$6,$S$10*$Y12))))))*$AH12),$T$6)

I can achieve what I want by adding an - If the above formula =0, cell "T6", or repeat the above.
but it just doubles the size of the formula.

I wondered if there was an easier way.
Any thoughts would be great.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Presumably you also want values in the range 0 to 0.1249999.... to round up to 0.25 too?

If your formula can't return negative values (?) you could simply wrap: =MAX(YourComplicatedFormula,$T$6)

YourComplicatedFormula can also be simplified. You can replace all IF(a<b,b,a) constructions with MAX(a,b) and similarly all IF(a>b,b,a) constructions with MIN(a,b)
 
Upvote 0
Solution
Yes everything where the formula produces a zero to 0.1249999 needs to move up to cell T6 which can be variable but in this instance it is 0.25.
The formula will always produce some zeros.
I will take a look at your suggestions later today and advise.
Thank you for your support.
 
Upvote 0

Forum statistics

Threads
1,214,867
Messages
6,122,002
Members
449,059
Latest member
mtsheetz

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