How to sum numbers separated by commas in one cell in Excel
Excel formula
=SUM(--TEXTSPLIT(B2,","))Split the text and add the pieces: =SUM(--TEXTSPLIT(B2,",")) in Excel 365, or =SUM(SPLIT(B2,",")) in Google Sheets.
- Result on the example
- one result per row in
C2, filled down toC6 - Works in
- Excel 2024 and Microsoft 365
- Google Sheets
- Different formula, see below
See it work
The formula is already in C2, filled down to C6. Change any input and the result updates, or edit the formula to experiment.
How it works
TEXTSPLIT breaks "12.5,8,15.25" into three pieces of text. The double minus turns them into numbers, because SUM skips numbers stored as text. Google Sheets' SPLIT already returns numbers, so SUM can add them directly. A cell with a single number, like 7.2, works too.
=SUM(--TEXTSPLIT(B2,","))Result35.75
B2"12.5,8,15.25"The value in B2.
TEXTSPLIT(B2,","){1 row × 3 cols} "12.5", "8", "15.25"TEXTSPLIT: Splits text across columns, and rows, at the delimiters you give.- text
B2"12.5,8,15.25" - col_delimiter
","
- text
-TEXTSPLIT(B2,","){1 row × 3 cols} -12.5, -8, -15.25Makes the value negative.
--TEXTSPLIT(B2,","){1 row × 3 cols} 12.5, 8, 15.25Makes the value negative.
SUM(--TEXTSPLIT(B2,","))35.75SUM: Adds numbers and ranges. Skips text and blanks.- number1
--TEXTSPLIT(B2,","){1 row × 3 cols} 12.5, 8, 15.25
- number1
In Google Sheets
Google Sheets needs a different formula: =SUM(SPLIT(B2,",")). On the same data it gives the same result. Here it is running in Google Sheets mode.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =SUM(VALUE(TEXTSPLIT(B2,",")))Excel only | 35.75, 10.75, 58.50… | VALUE does the same conversion as the double minus and reads more clearly. |
Common mistakes
- Without
--,=SUM(TEXTSPLIT(B2,","))returns 0 because every piece is text. - Spaces after commas ("12.5, 8") still convert, but other separators like semicolons need their own delimiter:
TEXTSPLIT(B2,{",",";"}). - TEXTSPLIT is Excel 365 only. In older versions, split the column with Data > Text to Columns first.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Sum numbers separated by commas in one cell
C2, add up the box weights listed in B2, then fill down to C6.Questions
How do I count the numbers in the cell?
Use =COUNTA(TEXTSPLIT(B2,",")), or in any version =LEN(B2)-LEN(SUBSTITUTE(B2,",",""))+1.
How do I average them?
Swap SUM for AVERAGE: =AVERAGE(--TEXTSPLIT(B2,",")).
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.