Thread: Fact()
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove[_2_] Harlan Grove[_2_] is offline
external usenet poster
 
Posts: 1,231
Default Fact()

Jitka wrote...
need to calculate fact(365) but getting #Num!. Any advice?


Do you really NEED to calculate 365!, or are you working with numbers
of the form n!/[(n-k)!k!] ? If the latter, and if you refuse to use
any of the standard algebraic reductions common in either probability
or combinatorics, you could probably get by using GAMMALN since ln(n!)
= GAMMALN(n+1), so n!/[(n-k)!k!] = ROUND(EXP(GAMMALN(n+1)/GAMMALN(n-k
+1)/GAMMALN(k+1)),0). The ROUND call is needed because Excel's GAMMALN
is only accurate to 10 decimal places and is really poor around 1 and
2 where it should return 0 exactly.