HI,
PLEASE EXPLAIN ME THE BELOW MENTIONED FORMULAE WITH EXAMPLE.
SUMPRODUCT(--MID(H13,ROW(INDIRECT("1:" & LEN(H13))),1)) |
<tbody>
</tbody>
THANKS.
It sums up the digits of a number.
01. MID is used to extract each digit...
Let H13 = 26.
MID(H13,2,1)
>> 6
That is, the digit at position 2.
02. ROW function can be used to produce a sequence like {1,2}...
ROW(INDIRECT("1:"&LEN(H13))
>>
ROW(INDIRECT("1:2"))
>>
{1,2}
03. SumProduct like Sum can sum a set of numbers from a range or an array
04. From above, we get using...
SUMPRODUCT(--MID(H13,ROW(INDIRECT("1:" & LEN(H13))),1))
>>
SUMPRODUCT(--MID(H13,ROW(INDIRECT("1:" &2)),1))
>>
SUMPRODUCT(--MID(H13,ROW(INDIRECT("1:2")),1))
>>
SUMPRODUCT(--MID(H13,{1;2},1))
>>
SUMPRODUCT(--MID(21,{1;2},1))
>>
SUMPRODUCT(--{"2";"1"})
>>
SUMPRODUCT({2;1})
>> 3
which is the sum of the digits of the numeric string of H13. Hope this helps.