Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: novski on May 02, 2016, 07:42:36 AM

Title: round (up/dwon)
Post by: novski on May 02, 2016, 07:42:36 AM
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
Title: Re: round (up/dwon)
Post by: RudySchneider on May 02, 2016, 01:35:20 PM
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.
Title: Re: round (up/dwon)
Post by: wapperdude on May 02, 2016, 03:50:32 PM
Search for Visio floor function works...

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

Wapperdude
Title: Re: round (up/dwon)
Post by: novski on May 03, 2016, 07:40:13 AM
Thanks, i mentioned the search throug this forum...
Title: Re: round (up/dwon)
Post by: novski on May 11, 2016, 01:56:55 PM
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...
Title: Re: round (up/dwon)
Post by: novski on May 11, 2016, 02:22:12 PM
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?
Title: Re: round (up/dwon)
Post by: RudySchneider on May 11, 2016, 02:50:01 PM
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)
Title: Re: round (up/dwon)
Post by: novski on May 11, 2016, 04:17:09 PM
You Rock! Even it was quite easy i didn't see it...
There are no problems, only opportunities!
Thanks a lot!
Regards, Novski