round (up/dwon)

Started by novski, May 02, 2016, 07:42:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

novski

As English is not enough specific in words the search spits out tonns of "around" & "Background" so searching for the possably right post is useless. Same for FLOOR wich resuslts in Floorplans...
Thats why i have to ask.

If i try to round a value in a usercell with FLOOR(user.cell1,0.5) i get a "180.5" as value out of it.
If i try to round a value in a usercell with FLOOR(user.cell1,0) i get a "0" as value out of it.

I don't understand why...

I wold like to get a pure 180 or 181.
same should hapen with 179.8 = 180
or 179.2 = 179

How can i realise that?

Regards, Novski

RudySchneider

Have you tried just using the ROUND function, which rounds off a number to the nearest digit?  That is, ROUND(179.2,0) and ROUND(179.8,0) result in 179 and 180, respectively.
There are no problems, only opportunities

wapperdude

Search for Visio floor function works...

Here's description: https://msdn.microsoft.com/en-us/library/office/ff766747.aspx

Wapperdude
Visio 2019 Pro

novski

Thanks, i mentioned the search throug this forum...

novski

#4
I tested the ROUND(number,roundedby) function and can not find out how it works.
In my test it does nothing. I will attach the file. Maybe somebody can tell me what im doing wrong...
Regards, Novski

EDIT: well the only point it does anything is by roundedby = 0, yes "RudySchneider" then it rounds up or down to the full value as you described...

novski

#5
oh now i just came over it. But ther is still another quesiton...

ROUND is only for the digits after the dot. so 18.6 wold round to 19 by ROUND(18.6,0). 17.22 to 17.2 by ROUND(17.22,1)
FLOOR downgrades to the next digit stated. so 18.6 wold FLOOR to 15 by FLOOR(18.6,5). 19.95 to 15 by FLOOR(19.95,5)

What i am searching for is a breaking point by 177 to 175 and 178 to 180 so a more advanced ROUND Function.

Any ideas?

RudySchneider

Ah, so you want to ROUND to the nearest increment of 5?

Well, there's more than one way to...

It may be a bit of a forcing function, but one way to accomplish what you're after is something like this:

NUMBER rounded to nearest 5 = 5 * ROUND(NUMBER/5,0)
There are no problems, only opportunities

novski

You Rock! Even it was quite easy i didn't see it...
There are no problems, only opportunities!
Thanks a lot!
Regards, Novski