Hello everyone
Does anyone know if this rounding is possible within same formula:
If my numbers are
1.62 round down to 1.60
1.65 keep same 1.65
1.67 round up to 1.7
Thanks for help !!
Hello everyone
Does anyone know if this rounding is possible within same formula:
If my numbers are
1.62 round down to 1.60
1.65 keep same 1.65
1.67 round up to 1.7
Thanks for help !!
What if it's 1.66?
Typically you'd use MROUND to round to nearest multiple. But in this case you can't use it, since it will round down 1.67 to nearest multiple of 0.05 (i.e. 1.65).
It's best, if you can give multiple example and expected return that captures your logic.
"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
― Robert A. Heinlein
Thank you for reply, here is what exactly I am hoping for
if 1.61 = round to 1.60
1.62 = 1.60
1.63 = 1.60
1.64 = 1.60
1.65 = 1.65
1.66 = 1.70
1.67 = 1.70
1.68 = 1.70
1.69 = 1.70
Hope this helps!!
May be...
=IF(RIGHT(TEXT(A2,"0.00"),1)="5",A2,ROUND(A2,1))
It works,
You are Genius!!
Thank you very much for your help.
Appreciate it.
You are welcome.
Just a note, text conversion was used here, as decimal conversion often causes floating point error and will result in inconsistent result.
If you are satisfied with the solution provided. Please mark the thread as solved by using thread tools found at top of your initial post.
Thank you again,
last question on this
What will be formula for this
if 1.61 = round to 1.65
1.62 = 1.65
1.63 = 1.65
1.64 = 1.65
1.65 = 1.65
1.66 = 1.70
1.67 = 1.70
1.68 = 1.70
1.69 = 1.70
And formula for
if 1.61 = round to 1.60
1.62 = 1.60
1.63 = 1.60
1.64 = 1.60
1.65 = 1.65
1.66 = 1.65
1.67 = 1.65
1.68 = 1.65
1.69 = 1.65
Really appreciate your help
For that you can just use Ceiling.Math function.
Ex:
=CEILING.MATH(A2,1/20)
EDIT: Oh wait. I misread. Should be FLOOR.MATH
=FLOOR.MATH(A2,1/20)
The first looks like a CEILING() function. =CEILING(number,0.05)
The second looks like a FLOOR() function. =FLOOR(number,0.05).
Originally Posted by shg
@MrShorty
Ya, I realized that when I was looking at his second question
Edit: Oh wait, didn't see another post he made. That confused me :p
Last edited by CK76; 07-30-2020 at 01:34 PM.
Thank you both of you.
Is there a way I can manipulate this formula you gave me earlier to get following?
Formula = =IF(RIGHT(TEXT(A2,"0.00"),1)="5",A2,ROUND(A2,1))
Result I expect is
1.61= 1.60
1.62= 1.60
1.63= 1.60
1.64= 1.60
1.65= 1.65
1.66= 1.65
1.67= 1.65
1.68= 1.65
1.69= 1.65
1.70= 1.70
Isn't that same as your post #8?
For post#7 use CEILING.MATH
For post#8 use FLOOR.MATH
Only reason I had to use Text function was because of special treatment of x.x5 in your original question.
And it worked perfectly fine with my first scenario.
For some reason its not working not sure what am I doing wrong
my value is
1.649 and to two decimal places it is 1.50 and I apply formula =floor.math(A1,0.05) and result it gives me is 1.60 instead it should be 1.65
1.649 is less than 1.65 so it will evaluate to 1.60 using FLOOR.MATH
You need to first ROUND(Value,2) then nest it in FLOOR.MATH.
But, I'd recommend adding helper column. Rather than doing it in single cell. To visually check that intermediate value is indeed what you expected.
Sounds like you want to round first to 2 decimals and then do your custom rounding. SO
Formula:
=FLOOR.MATH(ROUND(A2,2),1/20)
ChemistB
My 2?
substitute commas with semi-colons if your region settings requires
Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
You guys are awesome, thank you very much for all the help.
I got everything working now.
I will mark the thread solved.
Cheers!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks