Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel: calculate the amount - the numbers from a cell (58391) in another cell (5+8+3+9+1)

I have an excel cell that contains the number 58391. Is there a formula that can count (calculate the amount) the numbers (5+8+3+9+1) in another cell?

like image 890
Anao_ O Avatar asked Mar 04 '23 10:03

Anao_ O


1 Answers

Use SUMPRODUCT:

=SUMPRODUCT(--MID(A1,ROW($ZZ$1:INDEX($ZZ:$ZZ,LEN(A1))),1))

The Mid returns an array of the numbers, by iterating the start position from the array of numbers that the ROW returns.

enter image description here

like image 122
Scott Craner Avatar answered Apr 28 '23 23:04

Scott Craner