Excel : Sum of Digits in a Number using Non array Formulas

Last week Vijay asked how he can figure out the sum of the digits in a value. And he wanted to do it using a non-array formula .

01. Formula - Sum & Index

Assuming a value is entered in cell B4 i.e. 45454. The sum of the digits of this number is 22.

=SUM(INDEX(1*(MID(B4,ROW(INDIRECT("1:"&LEN(B4))),1)),,))

02. Formula - Sumproduct & Indirect

Assuming a value is entered in cell B4 i.e. 45454. The sum of the digits of this number is 22.

=SUMPRODUCT(MID(B4,ROW(INDIRECT("1:" & LEN(B4))),1)*1)

03. Formula - Sumproduct & Indirect

Assuming a value is entered in cell B4 i.e. 45454. The sum of the digits of this number is 22.

=SUMPRODUCT(MID(B4,ROW(OFFSET($A$1,,,LEN(B4))),1)+0)

04. Formula - Array Formula

For the people who enjoys hitting Ctrl Shift Enter. Assuming a value is entered in cell B4 i.e. 45454. The sum of the digits of this number is 22.

=SUM(MID(B4,ROW(INDIRECT("1:" & LEN(B4))),1)*1)

Note : Press F2 and Hit Ctrl Shift Enter to confirm the above array formula.

Download the Workbook
Spread the Word!
Share
Related Posts
About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 10 years of experience in data science. During his tenure, he has worked with global clients in various domains like Banking, Insurance, Private Equity, Telecom and Human Resource.

3 Responses to "Excel : Sum of Digits in a Number using Non array Formulas"
  1. There is one more.
    ctrl+shift+enter:
    =SUM(IFERROR(1*MID(B4,ROW($1:$99),1),))

    ReplyDelete
  2. THE FORMULAS WONT WORK FOR CELL WITH LINE BREAKS NUMBER VALUE

    ReplyDelete

Next → ← Prev

Looks like you are using an ad blocker!

To continue reading you need to turnoff adblocker and refresh the page. We rely on advertising to help fund our site. Please whitelist us if you enjoy our content.