Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How do I use the Gamma Function in Excel
Hi!
I'm trying to use a formula that contains the Gamma function in Excel but this does not seem to be under the list of functions. If I type its definition: Gamma(n)=(n-1)! it gives an error message when n-1 is not an integer. Has anyone got any ideas how I can get past this? Thanks |
#2
|
|||
|
|||
There is no intrinsic GAMMA function in Excel, although there are GAMMADIST,
GAMMAINV, GAMMALN. I suggest that you look these up in help to see what they do. -- HTH RP (remove nothere from the email address if mailing direct) "Cardiff Maths Student" <Cardiff Maths wrote in message ... Hi! I'm trying to use a formula that contains the Gamma function in Excel but this does not seem to be under the list of functions. If I type its definition: Gamma(n)=(n-1)! it gives an error message when n-1 is not an integer. Has anyone got any ideas how I can get past this? Thanks |
#3
|
|||
|
|||
Based on Bob's suggestion, try this:
Put the number you want Gamma of in A1. Put some other number in A2. "1" seems to work fine. Put =GAMMADIST(A2,A1,1,FALSE) in A3 Then you can get Gamma(A1) with =EXP(-A2)*A2^(A1-1)/A3 This appears to work for positive A1. Art |
#4
|
|||
|
|||
This may be easier than my previous post:
use =EXP(-1)/GAMMADIST(1,A1,1,FALSE) for Gamma(A1) Again, this doesn't appear to work for negative A1. Art |
#5
|
|||
|
|||
This is one way to get Gamma(A1):
=EXP(GAMMALN(A1)) It's been noted before that it's only good to about 9 or 10 digits of accuracy. -- Dana DeLouis Win XP & Office 2003 "Bob Phillips" wrote in message ... There is no intrinsic GAMMA function in Excel, although there are GAMMADIST, GAMMAINV, GAMMALN. I suggest that you look these up in help to see what they do. -- HTH RP (remove nothere from the email address if mailing direct) "Cardiff Maths Student" <Cardiff Maths wrote in message ... Hi! I'm trying to use a formula that contains the Gamma function in Excel but this does not seem to be under the list of functions. If I type its definition: Gamma(n)=(n-1)! it gives an error message when n-1 is not an integer. Has anyone got any ideas how I can get past this? Thanks |
#6
|
|||
|
|||
Thanks to all of you for your help! I think it's simplest to take the
exponential of the log of the Gamma function as Dana suggested, the degree of accuarcy is sufficient for my project, thanks again! |
#7
|
|||
|
|||
Dana DeLouis wrote...
This is one way to get Gamma(A1): =EXP(GAMMALN(A1)) It's been noted before that it's only good to about 9 or 10 digits of accuracy. GAMMALN's poorer around 1 and 2, where it evaluates negative. FWIW, the lngamma udf in the .xls file in following linked .zip file does a reasonable job, accurate to 14+ decimal digits. ftp://members.aol.com/hrlngrv/gammaln8.zip Perhaps in a few more versions Microsoft might actually use the publicly available (and not even GPLed) netlib code in all the 'engineering' and stats functions in Excel. --------- www.coffeecozy.com Use your Bodum and give up cold coffee for good! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? | Excel Discussion (Misc queries) | |||
Access Module coded converted to Excel Function | Excel Discussion (Misc queries) | |||
Excel function help facilities | Excel Discussion (Misc queries) | |||
I cant use englisch function names in a swedich version of excel | Excel Discussion (Misc queries) | |||
Statistical Excel Function Question within Excel 2000... | Excel Worksheet Functions |