You are on the Home/Other Tutorials/Project Euler/Problem 20 page
Google
Web This Site

Project Euler - Problem 20

More about Project Euler.

Problem description

n! means n x (n - 1) x ... x 3 x 2 x 1

Find the sum of the digits in the number 100!

Solution

Given the Large Number Arithmetic functions, in some cell in Excel (I used Cell S40) enter the function =LargeFactorial(2,1000).  Then, to compute the sum of the individual digits in the result, use the array formula =SUM(--MID(S40,ROW(INDIRECT("1:"&LEN(S40))),1))  To enter an array formula complete data entry with the CTRL+SHIFT+ENTER combination rather than just the ENTER or TAB key.  If done correctly, Excel will show the formula wrapped between curly brackets { and }