News:

Happy New Year!

Main Menu

LOG Function in Visio's ShapeSheet?

Started by bobfirth, June 03, 2010, 06:47:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bobfirth

Is there a LOG() function in Visio as there is in Excel? I can't seem to find (google) it. I want to use a logarithm with the base SQRT(2).

More specifically, I want to execute the following, but  the use of LOG() causes Visio to state that there is an "Unknown function name".
="A"&ROUND(LOG(1189/User.PageLength,SQRT(2)),0)

For those who are interested, this formula will return the paper size (it assumes it is metric ISO A series paper size. e.g. A4 or A3. User.PageLength is set to the longest dimension of the page, adjusted for any scaling. I want to print the page scale in the format "1:100 @ A3". I already have this working with a table of fixed values for each paper size, but the above formula seems much more elegant.

Yacine

#1
There is no Log(number,base) function in Visio as in Excel.
But, we know that it is equal to Log(number)/Log(base).
There are 2 Logarithms in Visio: base ten and e
So your formula should be:
"A"&ROUND(LOG10(1189/User.PageLength)/LOG10(SQRT(2)),0)

You may want to replace user.pagelength by max(thepage!pagewidth,thepage!pageheight)

My metric drawing would give the correct result with:
"A"&ROUND(LOG10(1189 mm/MAX(ThePage!PageWidth,ThePage!PageHeight))/LOG10(SQRT(2)),0)

----
As additional hint, I would suggest that, whilst editing the formula in your shapesheet, you open the insert menu / insert formula, there you find all the available functions.
Or  look here: http://msdn.microsoft.com/en-us/library/aa431851(office.12).aspx
Yacine

Visio Guy

#2
I thought that people just skimming this article would find this helpful.

Visio has two logarithmic ShapeSheet functions:

LOG10()
Ln()


For the natural logarithm, Ln, the base is e = 2.718281828459.

For fun you can check the bases--and make sure Visio's functions are correct--using the formula:

   b = n ^ (1/Log_b(n))

N is any number greater than 1, since there is sort of an exponent-cancellling that happens...

User.Base10 = 2 ^ ( 1 / LOG10(2) ) = 10
User.Base10 = 4.3 ^ ( 1 / LOG10(4.3) ) = 10

User.BaseE = 2 ^ ( 1/LN(2) ) = 2.718281828459
User.BaseE = 98.6 ^ ( 1/LN(98.6) ) = 2.718281828459


For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

JuneTheSecond

Your formulas are useful especially to get exponential number, e = 2.718281828459.  :) :) :)
Because Visio has not EXP function while Visio has PI function.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

bobfirth

Ahh yes! Thanks for your help Yacine. Unfortunately it's been for too long since High School... I seem to have forgotten all of these useful logarithm facts.

User.PageLength is:
MAX(ThePage!PageWidth,ThePage!PageHeight)/(ThePage!DrawingScale/ThePage!PageScale)

So for anyone who wants this all in one easy formula for pasting, this should work:
="A"&ROUND(LOG10(1189MM/(MAX(ThePage!PageWidth,ThePage!PageHeight)/(ThePage!DrawingScale/ThePage!PageScale)))/LOG10(SQRT(2)),0)

Bob

Yacine

QuoteUser.PageLength is: ... /(ThePage!DrawingScale/ThePage!PageScale)
of course  :-\  ;D
Yacine

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 280 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1127KB.
Tokens: post-login.
Cache hits: 13: 0.00199s for 26,563 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]