How to Calculate the Sum of Digits with Excel Formulas
Question details
The user needs to calculate the sum of individual digits within a single number (e.g., adding 1+2+3 for the number 123) using an Excel formula.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Breaking down a multi-digit number stored in a single cell and mathematically summing its individual digits.
- Observed behavior
- The correct formula combination depends entirely on the version of Excel being used, as newer versions support dynamic arrays like SEQUENCE while older ones require SUMPRODUCT.
Ensure that the cell containing the target number does not have any non-numeric characters, spaces, or negative signs, as these will cause the mathematical formula to return a #VALUE! error.
Use the SEQUENCE and MID Functions (Excel 365)
For users on Excel 365, combining SUM, MID, and SEQUENCE provides a clean, non-volatile way to calculate the digit sum.
This method utilizes Excel's newer dynamic array capabilities. It is generally preferred over older methods because it does not use volatile functions, which means it will not slow down your workbook's performance during recalculations.
Click on an empty cell where you want the calculated sum to appear.
Type the formula `=SUM(MID(A1,SEQUENCE(LEN(A1)),1)+0)`, replacing 'A1' with the cell reference that contains your target number.
Press Enter. The formula will extract each digit, convert the text strings to numbers, and sum them up automatically.

Use the SUMPRODUCT and INDIRECT Functions (All Versions)
If you are using an older version of Excel that does not support the SEQUENCE function, you can use SUMPRODUCT combined with ROW and INDIRECT.
Calculate Digit Sums Easily with WPS Spreadsheet
WPS Spreadsheet fully supports advanced array functions like SUMPRODUCT, MID, and LEN. You can seamlessly apply these exact formulas to process your numerical data without worrying about complex array entry keystrokes or compatibility issues.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your existing spreadsheet containing the numerical data.
- 2. Apply the digit-sum formula: Click on a blank cell and input the SUMPRODUCT or array formula just as you would in standard Excel.
- 3. Get the instant result: Press Enter to instantly get the sum of the digits without any extra configuration.

Frequently Asked Questions
Why does my sum of digits formula return a #VALUE! error?
This typically happens if the target cell contains text letters, spaces, or special characters. Ensure the cell only contains numerical digits, or use the SUBSTITUTE function inside your formula to remove spaces before calculating the sum.
How can I calculate the sum of digits for a negative number?
The negative sign (-) is treated as text by the MID function, causing an error. To fix this, wrap the cell reference in the ABS function (which returns the absolute value) to ignore the minus sign. For example: `=SUM(MID(ABS(A1),SEQUENCE(LEN(ABS(A1))),1)+0)`.
Do I need to press Ctrl+Shift+Enter for these formulas?
No. Both the SUMPRODUCT method for older Excel versions and the SEQUENCE method for Excel 365 natively handle arrays internally. You only need to press the standard Enter key for the calculation to work.




