LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default LN in UDF

Hi! I am trying to write a UDF. The function works fine if I just write it as
a worksheet function. For several reasons I need it as a UDF though. Excel
tells me "Sub or function not defined" where Ln is. How am I supposed to
write this? It looks fine to me..Ay help appreciated!

Public Function Kupiec(p As Double, T As Double, N As Double) As Double
Dim a As Double
Dim b As Double

a = -2 * Ln((1 - p) ^ (T - N) * p ^ N)
b = 2 * Ln(1 - (N / T)) ^ (T - N) * (N / T) ^ N

Kupiec = a + b

End Function


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"