How to Sum the First Three Numbers from an Excel Formula
Question details
The user needs to extract the first three numerical values from an existing text formula (e.g., =1+3+6+9) in a cell and calculate their total sum without relying on VBA macros.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Extracting and summing specific parts of a written formula string dynamically within a spreadsheet cell.
- Observed behavior
- Requires a formula in cell A2 to automatically parse the components of the formula text located in cell A1 and add only the first three numbers together.
Ensure you are using a modern version of your spreadsheet software that supports dynamic array functions like TEXTSPLIT and TAKE.
Use Dynamic Array Functions (FORMULATEXT, TEXTSPLIT, TAKE)
This method combines several text and array functions to extract, split, and sum the required numbers seamlessly without needing VBA code.
This approach relies on extracting the raw text of the formula, stripping the equals sign, splitting the string at each plus sign, isolating the first three components, and finally adding them together.
Click on cell A2, or whichever cell you want to display the calculated sum.
Type the following formula into the formula bar: =SUM(--TAKE(TEXTSPLIT(MID(FORMULATEXT(A1),2,100),"+"),,3))
Press Enter. The cell will dynamically process the text from the formula in A1 and output the sum of its first three numbers.

Solve Complex Formula Extractions Easily with WPS Office
WPS Spreadsheet provides comprehensive support for advanced functions, allowing you to manipulate strings, arrays, and perform complex calculations exactly as you would in Microsoft Excel.
- 1. Open your document: Launch WPS Office and open your spreadsheet file.
- 2. Select the output cell: Click on the target cell where you want the sum to be displayed.
- 3. Input the dynamic formula: Type in the formula combining SUM, TAKE, and TEXTSPLIT to extract the numbers from your target cell.
- 4. Execute the calculation: Press Enter to instantly view your extracted and calculated total.

Frequently Asked Questions
Can I use this formula if my numbers are separated by minus signs instead of plus signs?
Yes, but you will need to adjust the delimiter in the TEXTSPLIT function from "+" to "-". If your formula contains mixed mathematical operators, you may need a more advanced parsing method or multiple delimiters.
Why do I get a #NAME? error when using this formula?
The #NAME? error typically occurs if you are using an older version of your spreadsheet software that does not recognize newer dynamic array functions like TEXTSPLIT or TAKE. Upgrading to the latest software version resolves this.
What does the double dash (--) do in the formula?
The double dash is a double unary operator. It forces the text strings extracted by the TEXTSPLIT function to convert into numerical values, enabling the SUM function to calculate them mathematically.
How can I extract more than three numbers using this method?
You can easily modify the formula by changing the number '3' at the end of the TAKE function to the specific number of values you wish to extract and sum from the source cell.




