Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Rushi
 
Posts: n/a
Default Range of Factorial Function

Hi,

For some analysis I am doing, I tried the following LOG(FACT(229)), and it
returned NUM!. I am wondering if 229 is too big a number to compute a
Factorial of ? If so, is there an upper limit (something like FACT function
can be applied for numbers <= 150) for the FACT function ?

Thanks in anticipation,

Rushi Patel
  #2   Report Post  
Ian
 
Posts: n/a
Default

A little experimantation reveals that FACT(170) is the largest possible,
returning a value of 7.2574E+306.


--
Ian
--
"Rushi" wrote in message
...
Hi,

For some analysis I am doing, I tried the following LOG(FACT(229)), and it
returned NUM!. I am wondering if 229 is too big a number to compute a
Factorial of ? If so, is there an upper limit (something like FACT
function
can be applied for numbers <= 150) for the FACT function ?

Thanks in anticipation,

Rushi Patel



  #3   Report Post  
Dana DeLouis
 
Posts: n/a
Default

Hi. 229! has 443 digits in it, so it's too big for both the worksheet and
vba. (27! being the max in Vba)
Here's just one workaround:

Function LogFactorial(n) As Double
Dim ans As Double
Dim j As Long
For j = 1 To n
ans = ans + Log(j)
Next j
LogFactorial = ans
End Function

Test:
? LogFactorial(229)
1018.95850224969

Which checks with another program:

Log[229!]
1018.9585022496902

HTH ;)
--
Dana DeLouis
Win XP & Office 2003


"Rushi" wrote in message
...
Hi,

For some analysis I am doing, I tried the following LOG(FACT(229)), and it
returned NUM!. I am wondering if 229 is too big a number to compute a
Factorial of ? If so, is there an upper limit (something like FACT
function
can be applied for numbers <= 150) for the FACT function ?

Thanks in anticipation,

Rushi Patel



  #4   Report Post  
TomHinkle
 
Posts: n/a
Default

Ian's experimentation is consistant with the range of a double precision
floating point numer (what excel uses for calculating values)

lol.. sounds like you need a cray!!

Double Data Type


Double (double-precision floating-point) variables are stored as IEEE 64-bit
(8-byte) floating-point numbers ranging in value from -1.79769313486231E308
to -4.94065645841247E-324 for negative values and from 4.94065645841247E-324
to 1.79769313486232E308 for positive values. The type-declaration character
for Double is the number sign (#).


"Ian" wrote:

A little experimantation reveals that FACT(170) is the largest possible,
returning a value of 7.2574E+306.


--
Ian
--
"Rushi" wrote in message
...
Hi,

For some analysis I am doing, I tried the following LOG(FACT(229)), and it
returned NUM!. I am wondering if 229 is too big a number to compute a
Factorial of ? If so, is there an upper limit (something like FACT
function
can be applied for numbers <= 150) for the FACT function ?

Thanks in anticipation,

Rushi Patel




  #5   Report Post  
Dana DeLouis
 
Posts: n/a
Default

Oops. Didn't even think of this:

=GAMMALN(229+1)

1018.95850224964

HTH :)
--
Dana DeLouis
Win XP & Office 2003


"Dana DeLouis" wrote in message
...
Hi. 229! has 443 digits in it, so it's too big for both the worksheet and
vba. (27! being the max in Vba)
Here's just one workaround:

Function LogFactorial(n) As Double
Dim ans As Double
Dim j As Long
For j = 1 To n
ans = ans + Log(j)
Next j
LogFactorial = ans
End Function

Test:
? LogFactorial(229)
1018.95850224969

Which checks with another program:

Log[229!]
1018.9585022496902

HTH ;)
--
Dana DeLouis
Win XP & Office 2003


"Rushi" wrote in message
...
Hi,

For some analysis I am doing, I tried the following LOG(FACT(229)), and
it
returned NUM!. I am wondering if 229 is too big a number to compute a
Factorial of ? If so, is there an upper limit (something like FACT
function
can be applied for numbers <= 150) for the FACT function ?

Thanks in anticipation,

Rushi Patel







  #6   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Since he wanted LOG not LN,

=GAMMALN(229+1)/LN(10)

Bernie

Oops. Didn't even think of this:


I'm impressed....


  #7   Report Post  
Jay
 
Posts: n/a
Default

For some analysis I am doing, I tried the following LOG(FACT(229)),
and it returned NUM!. I am wondering if 229 is too big a number to
compute a Factorial of ? If so, is there an upper limit (something
like FACT function can be applied for numbers <= 150) for the FACT
function ?



Recall that LOG(A*B) = LOG(A) + LOG(B)

So LOG(FACT(229)) = LOG(1)+LOG(2)+...+LOG(229)

In A1:A229, put
=LOG(ROW())

Then in B2 put
=SUM(A:A)
  #8   Report Post  
Dana DeLouis
 
Posts: n/a
Default

A 1-Cell entry along this same theme might be something like this:

=SUMPRODUCT(LOG(ROW(INDIRECT("1:229"))))

--
Dana DeLouis
Win XP & Office 2003


"Jay" wrote in message
8.16...
For some analysis I am doing, I tried the following LOG(FACT(229)),
and it returned NUM!. I am wondering if 229 is too big a number to
compute a Factorial of ? If so, is there an upper limit (something
like FACT function can be applied for numbers <= 150) for the FACT
function ?



Recall that LOG(A*B) = LOG(A) + LOG(B)

So LOG(FACT(229)) = LOG(1)+LOG(2)+...+LOG(229)

In A1:A229, put
=LOG(ROW())

Then in B2 put
=SUM(A:A)



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
"COUNTU" function in Excel to count unique entries in a range WayneL Excel Worksheet Functions 20 September 19th 08 03:50 AM
Number range function Sonya T Excel Discussion (Misc queries) 2 July 19th 05 01:19 AM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Function that filters a list (Database) for criteria in a range a. FirstVette52 Excel Worksheet Functions 0 February 8th 05 05:37 PM


All times are GMT +1. The time now is 12:29 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"