View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default Formula confusion

ShaneDevenshire wrote...
....
Another problem with this is that FACT(234) exceeds Excel's
capacity. The max is FACT(170).

....

But 12^234/234! is within Excel's numerical capability. You just need
to use some basic numerical cleverness.

=EXP(LN(12)*234-GAMMALN(234+1))

returns 1.48921424053937E-202, which agrees somewhat with bc (scale =
217),

..000000000000000000000000000000000000000000000000 0000000000000000\
00000000000000000000000000000000000000000000000000 000000000000000\
00000000000000000000000000000000000000000000000000 000000000000000\
00000001489214240465480301

which in turn agrees somewhat more closely with R,

1.48921424046555e-202

Basically, Excel sucks at this sort of thing. There may be
alternatives that work better in Excel, but the OP would need to
mention what he really wants to do.

But back to the OP's question,

=IF(n<0,"n must be nonnegative",EXP(LN(x)*n-GAMMALN(n)))