Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Cardiff Maths Student
 
Posts: n/a
Default 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   Report Post  
Bob Phillips
 
Posts: n/a
Default

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   Report Post  
Art
 
Posts: n/a
Default

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   Report Post  
Art
 
Posts: n/a
Default

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   Report Post  
Dana DeLouis
 
Posts: n/a
Default

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   Report Post  
Cardiff Maths Student
 
Posts: n/a
Default

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   Report Post  
hrlngrv - ExcelForums.com
 
Posts: n/a
Default

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
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Access Module coded converted to Excel Function Adam Excel Discussion (Misc queries) 1 December 23rd 04 02:48 PM
Excel function help facilities RPS Excel Discussion (Misc queries) 1 December 8th 04 02:36 AM
I cant use englisch function names in a swedich version of excel PE Excel Discussion (Misc queries) 2 December 7th 04 01:00 AM
Statistical Excel Function Question within Excel 2000... Drew H Excel Worksheet Functions 3 October 31st 04 06:55 PM


All times are GMT +1. The time now is 02:48 AM.

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

About Us

"It's about Microsoft Excel"