View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson Myrna Larson is offline
external usenet poster
 
Posts: 863
Default Help with Similar MOD Function Please

Hmmm.... That doesn't look at all like Dana's formula. The one he posted was

=MOD(A1-1,9)+1

I put these numbers in A1:F1

492 12 259 158 314 54

If I use Dana's formula on each of these cell individually, the results are

6 3 7 5 8 9

The sum of those numbers is 38. Summing those digits, I get 11, then 2.

If 2 is the result that is wanted, the formula is the "normal" (i.e. not
array) formula

=MOD(SUM(A1:F1)-1,9)+1

If I use the formula you show below, the result I get is 155. To get 2, you
must sum the digits of that result.

BTW, using the worksheet MOD function, in the general situation, MOD(A1-1,9)+1
does not give NOT the same as MOD(A1,10). The two formulas give different
results when the original number is 0: 9 vs 0. (With VBA's MOD operator, the
results are both 0).


On 3 Dec 2004 05:55:38 -0800, (Paul Black) wrote:

The Second is to Sum the Individual Digits in a Range of Cells ( For
Example "A1:F1" ) Posted by Dana DeLouis :-
=SUM(INT(A1:F1/10)+MOD(A1:F1,10))
Array Entered.