By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

Calculating ln()

P: 65
Hi,

I'm trying to make some calculations on zome vars I've got. Now in Excell there is a function ln() (natural logarithm), I need the same function in access. Now in access I can only find the log() function. It doesn't return the same value.

Thanx
Twanne
Jul 27 '07 #1
Share this Question
Share on Google+
6 Replies


P: 65
I've solved the problem. It was a purely mathematical problem.

Log(x) = ln(x)/ln(10)

So ln(x) = Log(x) * ln(10)

For everybody who happens to run in to this problem.
Jul 27 '07 #2

Expert 100+
P: 634
I've solved the problem. It was a purely mathematical problem.

Log(x) = ln(x)/ln(10)

So ln(x) = Log(x) * ln(10)

For everybody who happens to run in to this problem.
Im now sure that solves your problem as you cannot sole the equation for Ln(x) without using Ln() ?

I think it should be
ln(x)=Log(x)/Log(e) ??

MTB
Jul 27 '07 #3

P: 65
ln(10) is a fixed number you can calculate ;)

but actualy, the formulae worked. But then I came across the problem that LOG(x) in excell and Log(x) in vba are two different things. Log(x) in vba is the same as LN(x) in excell. This is probably to keep things "simple". I have no idea why microsoft did this but I figured it out.
Jul 30 '07 #4

missinglinq
Expert 2.5K+
P: 3,532
Micro$oft corporate policy is to never make anything too easy!

Linq ;0)>
Jul 30 '07 #5

Expert 100+
P: 634
Micro$oft corporate policy is to never make anything too easy!

Linq ;0)>
I will definitely second that!

However, ln(10) is calculable, but not using the ln() function, as it doesn't exist, thus making the statement invalid!

In fact,
ln(10) = 1/LOG(e) [where Log is to base 10]
so you could use this in code, assuming you know what 'e' is!

Having said all that, looking at both Excel & Access Log functions (in VBA), both only have a built in natural log function, so I am not sure what the problem is/was ???


MTB
Jul 30 '07 #6

P: 65
Wel I needed to calculate ln() af a certain value, but because ln() isn't a function in VBA I needed to get around it.

Like MTB said ln(10) = 1/LOG(e) in real math. But as you can see real math isn't used by microsoft. I also said before that ln() in excell is the same as LOG() in vba (why this is so, I don't know).
Anyhow I got around it by using LOG() in vba for ln() in ecxell.

For the record e is a constant: 2.71828182845904 (had to search it to because I didn't know it by hart myself :D )

Greetz
Twanne
Jul 30 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.