Odd rounding question indead

tbowland

New Member
Joined
Jul 13, 2017
Messages
3
This question comes in relation to the retail industry.
We have what are call nice numbers in reference to Sell prices.
You will have noted that you rarely see items for sale for $24.72
We would round this number up to $24.75

So the question...after calculating a sell price from cost and Margin I need to round it up to the nearest "nice" decimal point
They are, and this is the crazy challenging part, .15, .25, .35, .50, .65, .75, .85, .90.
There is no pattern here so all I can think of is a ceiling function and the maximum imbedded if functions.
:(
Any help would be hugely appreciated
Thanks
Ted
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Can you post selling before in Col A and desired selling price in Col B?
This will assist everyone to understand your question properly.
 
Last edited:
Upvote 0
Assuming you want to round up every time use: =CEILING(A1,0.05)

If you want to round up & down use: =ROUND(A1/0.05,0)*0.05
 
Upvote 0
Hello,

My understanding of your question would lead to following :
Code:
INT(A1)+(IF(MOD(A1,INT(A1))<=0.15,0.15,IF(MOD(A1,INT(A1))<=0.25,0.25,IF(MOD(A1,INT(A1))<=0.35,0.35,IF(MOD(A1,INT(A1))<=0.5,0.5,IF(MOD(A1,INT(A1))<=0.65,0.65,IF(MOD(A1,INT(A1))<=0.75,0.75,IF(MOD(A1,INT(A1))<=0.85,0.85,0.9))))))))

Hope this will help
 
Upvote 0
Or perhaps: =INT(A1)+INDEX({1,0.9,0.85,0.75,0.65,0.5,0.35,0.25,0.15,0},MATCH(ROUND(A1-INT(A1),15),{1,0.9,0.85,0.75,0.65,0.5,0.35,0.25,0.15,0},-1))
 
Upvote 0
That is so so great thanks everyone for all your help. StephenCrump, I used yours as it was the short and simplest, thanks.

BIZ, I built the Sell price formula in ' =INT(([@[Cost/ Unit]]/(1-$P$9)))+INDEX({1,0.95,0.85,0.75,0.65,0.5,0.35,0.25,0.15,0},MATCH(ROUND(([@[Cost/ Unit]]/(1-$P$9))-INT(([@[Cost/ Unit]]/(1-$P$9))),15),{1,0.95,0.85,0.75,0.65,0.5,0.35,0.25,0.15,0},-1)) '

I seems to work great.
Thank you again everyone
Ted
 
Upvote 0
It would be easier using same formula but put the custom list ie 1,0.95,0.85,0.75,0.65,0.5,0.35,0.25,0.15,0 to column K1:K11.

=INT(A2)+INDEX($K$1:$K$11,MATCH(ROUND(A2-INT(A2),15),$K$1:$K$11,-1))

Visually the formula very compact plus if your custom list changes don't need to copy formula to multiple cells. Assuming adding extra row add on the second list row. Even better convert the range to table.
 
Upvote 0

Forum statistics

Threads
1,215,787
Messages
6,126,905
Members
449,348
Latest member
Rdeane

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