Want to understand the below formulae

uttamkumar1234

New Member
Joined
Aug 26, 2015
Messages
9
HI,

PLEASE EXPLAIN ME THE BELOW MENTIONED FORMULAE WITH EXAMPLE.

[TABLE="width: 88"]
<tbody>[TR]
[TD="width: 88"]SUMPRODUCT(--MID(H13,ROW(INDIRECT("1:" & LEN(H13))),1))[/TD]
[/TR]
</tbody>[/TABLE]

THANKS.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
It's taking a number and adding up all the digits, e.g. 198732 produces 30 1+9+8+7...

It extracts each digit in H13 and using an array adds them up.
INDIRECT("1:"&LEN(H13)) produces a count 1,2,3,4,5 etc up to the length of the number. Each digit is then placed into the MID(H13...,1) to extract the 1st 2nd 3rd etc character
SUMPRODUCT then adds them up
 
Upvote 0
HI,

PLEASE EXPLAIN ME THE BELOW MENTIONED FORMULAE WITH EXAMPLE.

[TABLE="width: 88"]
<tbody>[TR]
[TD="width: 88"]SUMPRODUCT(--MID(H13,ROW(INDIRECT("1:" & LEN(H13))),1))[/TD]
[/TR]
</tbody>[/TABLE]

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.
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top