Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA and norminv

hi

can anybody tell why this doesn't work, or better yet show me how t
make it work

Function Dandy(P As Double, rng)
Dim M As Double
M = Application.Average(rng)
Dim S As Double
S = Application.StDev(rng)

Dandy = Application.Norminv(P, M, S)
End Function

What im tryin to do is write a UDF tha replaces this
=Norminv(P, average(range), Stdev(range)

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 837
Default VBA and norminv

It seems to work for me in Excel XP. Give an example of what you are
passing and what unacceptable results you are getting.

Jerry

ksnapp < wrote:

hi

can anybody tell why this doesn't work, or better yet show me how to
make it work

Function Dandy(P As Double, rng)
Dim M As Double
M = Application.Average(rng)
Dim S As Double
S = Application.StDev(rng)

Dandy = Application.Norminv(P, M, S)
End Function

What im tryin to do is write a UDF tha replaces this
=Norminv(P, average(range), Stdev(range))


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default VBA and norminv

I'm not a stats person, but would taking the StDev of the population
(StDevP) work? I am not sure what you mean by "doesn't work."

Function Dandy(P As Double, rng As Range)
Dim M As Double
Dim S As Double

With WorksheetFunction
M = .Average(rng)
S = .StDevP(rng)
Dandy = .NormInv(P, M, S)
End With
End Function


--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"ksnapp " wrote in message
...
hi

can anybody tell why this doesn't work, or better yet show me how to
make it work

Function Dandy(P As Double, rng)
Dim M As Double
M = Application.Average(rng)
Dim S As Double
S = Application.StDev(rng)

Dandy = Application.Norminv(P, M, S)
End Function

What im tryin to do is write a UDF tha replaces this
=Norminv(P, average(range), Stdev(range))


---
Message posted from http://www.ExcelForum.com/



Reply
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 04:00 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"