Ceiling & Floor function with constraints

helenkim

New Member
Joined
Feb 2, 2011
Messages
39
Hi All,
Need help formulating a formula, please. I want to use the CEILING and FLOOR function but have constraints.
I have a database of numbers and depending whether the number is +- 20% from a set value and its increments, I want it to perform either the CEILING or the FLOOR function.

For ex, I have the numbers 85. And a I have a set value of 30 or increments of 30 rather. If 85 is withing 20% of 90 (which is an increment of the set value 30), I want it to do the CEILING function and return me a value of 90. In this case, I know 85 is within the 20% of 90 so it should return 90.

However, if i had the number 65, the formula should return the value of 60, not 90, since, 65 is closer to 60 than to 90.

Does this make sense? Any ideas?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Thanks for teaching me a new function! but the MROUND function only takes the midpoint. I need it to be within 20%. Therefore I think I have to formulate and IF statement and then use the CEILING and FLOOR functions.

What do you think?
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,242
Members
452,898
Latest member
Capolavoro009

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