How to Sum Numbers Enclosed in Square Brackets in Excel
Question details
The user needs to calculate the total sum of numerical values that are surrounded by square brackets.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Attempting to add up a column or range of values where numbers appear with brackets, such as [8], [12], and [25].
- Observed behavior
- Excel's standard AutoSum or SUM function fails and returns a 0 because the brackets cause the spreadsheet to treat the numbers as text.
Check whether your values are stored as actual text or just formatted as numbers. If the cells align to the right by default, they are likely numbers with a custom format, and standard AutoSum will work immediately. If they align to the left, they are stored as text and require data extraction.
Use SUBSTITUTE or TEXTBEFORE Formulas to Extract and Sum
Use this method if your data is stored as text and you want a dynamic solution that updates automatically when values change without altering the original cells.
By nesting SUBSTITUTE or text extraction formulas inside a SUM function, you can temporarily strip away the brackets during the calculation process.
Click on a blank cell where you want the final calculated total to appear.
Type the formula =SUM(--SUBSTITUTE(SUBSTITUTE(B1:B4,"[",""),"]","")) (assuming your data is in B1:B4) and press Enter. In older versions of Excel, you may need to press Ctrl+Shift+Enter to evaluate it as an array formula.
If you are using Excel 365 or Excel 2021, you can use the newer text functions by typing =SUM(--TEXTBEFORE(TEXTAFTER(B1:B4,"["),"]")) and pressing Enter.

Use Find and Replace to Remove Brackets
This is a quick, one-off solution to clean the data permanently so you can use the standard AutoSum tool.
Apply Custom Number Formatting for Future Data Entry
To prevent calculation errors in the future, store your data as plain numbers but display them with brackets visually using custom formatting.
Sum Bracketed Numbers Seamlessly in WPS Spreadsheet
WPS Spreadsheet fully supports advanced array formulas, nested text functions, and comprehensive custom formatting, making it incredibly simple to calculate totals from complex data strings like bracketed text.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your bracketed values.
- 2. Apply the text extraction formula: Select a blank cell and enter =SUM(--SUBSTITUTE(SUBSTITUTE(A1:A5,"[",""),"]","")) to dynamically calculate the sum of the text strings.
- 3. Use custom formatting: Alternatively, select plain numbers, press Ctrl+1 to open Format Cells, and apply the [#] custom format to keep data mathematically active while displaying brackets.

Frequently Asked Questions
Why does my SUM function return zero when adding bracketed numbers?
When numbers are typed manually with brackets, the spreadsheet program treats the entire entry as a text string rather than a numeric value. The standard SUM function ignores text, which results in a calculation of zero.
Can I sum numbers inside parentheses instead of square brackets?
Yes. You can use the exact same formula method by swapping the square brackets for parentheses: =SUM(--SUBSTITUTE(SUBSTITUTE(B1:B4,"(",""),")","")). However, keep in mind that standard accounting formats often treat plain numbers enclosed in parentheses as negative numbers automatically.
Do I need to use array formulas for these SUBSTITUTE methods?
In modern spreadsheet software with dynamic arrays, you can simply type the formula and press Enter. In much older versions, you may need to confirm the formula by pressing Ctrl+Shift+Enter to ensure the array of cells is processed correctly.




