Function Problems

How to Sum Numbers Enclosed in Square Brackets in Excel

Kushani NimanthikaKushani Nimanthika Nov 10, 2026 868 views

Question details

The user needs to calculate the total sum of numerical values that are surrounded by square brackets.

How to Sum Numbers Enclosed in Square Brackets in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the destination cell

Click on a blank cell where you want the final calculated total to appear.

2
Apply the SUBSTITUTE formula

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.

3
Alternative for newer Excel versions

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 SUBSTITUTE or TEXTBEFORE Formulas to Extract and Sum
Formula Breakdown: The double negative (--) in the formula forces Excel to convert the extracted text back into a true numerical value so that the SUM function can process it properly.
Handle Complex Data Easily

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. 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your bracketed values.
  2. 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. 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.
100% compatible with standard Excel formulas, including SUBSTITUTE and SUM arrays.Built-in Find and Replace and Format Cells tools for rapid data cleaning.Lightweight, fast, and free to use for both personal and professional data management.
microsoft office alternative - wps office

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.