You're getting the #NUM! error because you didn't press CTRL+SHIFT+ENTER after typing the formula as I said in my post above.

Copy my formula from above, then switch to Excel. Double-click cell D1 to go into cell edit mode then press CTRL+V to paste the formula. Once the formula is in the cell, hold down CTRL and SHIFT and then press ENTER. After hitting Enter you can let go of all three buttons.

D1 should now say "1". Fill that down to D10 and you should get the correct results.