Google Sheets: Need to total numbers contained in the same cells as text.

Matthew Sid

New Member
Joined
Feb 2, 2022
Messages
5
Office Version
  1. 2019
Platform
  1. Windows
I've been searching and trying different formulas for hours and got nowhere. I need to total the numbers in a row that contains both text and numbers excluding black cells
Example: B4 = "2 Dave", B5="4 Steve"
I want that to show a total of 6.

Tried SUMIF and SUMPRODUCT with ISNUMBER, but just getting errors.

Any help is appreciated. Thanks
 
Last edited by a moderator:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi,

If the Text strings Always start with the number followed by space, try:

Book3.xlsx
BCD
3Result
42 Dave19
54 Steve
613 John
Sheet982
Cell Formulas
RangeFormula
D4D4=SUMPRODUCT(LEFT(B4:B6,FIND(" ",B4:B6))+0)
 
Upvote 0
contains both text and numbers excluding black cells
If those were meant to be blank cells then you might need an adjustment to @jtakw's formula. For example:

22 02 03.xlsm
BCD
3Result
42 Dave19
54 Steve
6
713 John
Sum
Cell Formulas
RangeFormula
D4D4=SUMPRODUCT(LEFT(B4:B7&0,FIND(" ",B4:B7&" "))+0)
 
Upvote 0
Thanks @Peter_SSs , missed the "black" > blank cells part.

Here's another way just in case there are also cells that are text only:

Book3.xlsx
BCD
3Result
42 Dave19
54 Steve
6abc
7
813 John
Sheet982
Cell Formulas
RangeFormula
D4D4=SUM(IFERROR(LEFT(B4:B8,FIND(" ",B4:B8)),0)+0)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thanks @Peter_SSs , missed the "black" > blank cells part.

Here's another way just in case there are also cells that are text only:

Book3.xlsx
BCD
3Result
42 Dave19
54 Steve
6abc
7
813 John
Sheet982
Cell Formulas
RangeFormula
D4D4=SUM(IFERROR(LEFT(B4:B8,FIND(" ",B4:B8)),0)+0)
Press CTRL+SHIFT+ENTER to enter array formulas.
[/R
Cell Formulas
RangeFormula
Press CTRL+SHIFT+ENTER to enter array formulas.

Thanks @Peter_SSs , missed the "black" > blank cells part.

Here's another way just in case there are also cells that are text only:

Book3.xlsx
BCD
3Result
42 Dave19
54 Steve
6abc
7
813 John
Sheet982
Cell Formulas
RangeFormula
D4D4=SUM(IFERROR(LEFT(B4:B8,FIND(" ",B4:B8)),0)+0)
Press CTRL+SHIFT+ENTER to enter array formulas.
Thanks. So tried all the suggested formulas in Excel and all worked. However, forgot to mention that the actual document is a Google Sheet, and the last formula
 
Upvote 0
Thanks. So tried all the suggested formulas in Excel and all worked. However, forgot to mention that the actual document is a Google Sheet, and the last formula (IFERROR) was the only one that worked in the first two cells, but then got a #VALUE error in subsequent cells as follows.

"Function ADD parameter 1 expects number values. But "J" is text and cannot be coerced to a number"

Tried to format the cell as a number, but no luck.

Sorry, offered to help a friend and not that familiar with Google Sheets.
 
Upvote 0
the actual document is a Google Sheet
In that case the question should not be asked in the Excel Questions forum ;)
1643852315821.png

I have moved it
1643852377885.png
 
Upvote 0
Here's another way just in case there are also cells that are text only:
I know this is no longer an Excel question, but I think you have your IFERROR final argument in the wrong place as it still fails if the text entry contains any space characters. :)
Should be this?
Excel Formula:
=SUM(IFERROR(LEFT(B4:B8,FIND(" ",B4:B8))+0,0))
 
Upvote 0
I know this is no longer an Excel question, but I think you have your IFERROR final argument in the wrong place as it still fails if the text entry contains any space characters. :)
Should be this?
Excel Formula:
=SUM(IFERROR(LEFT(B4:B8,FIND(" ",B4:B8))+0,0))

Seems to work either way, number conversion 1st, error convert to 0 (as you suggest), or
error convert to 0, then convert to number (as you see in my Post # 4 above)

EDIT: I see what you mean, leading and/or trailing spaces, or multiple text (words).
 
Upvote 0
I know this is no longer an Excel question, but I think you have your IFERROR final argument in the wrong place as it still fails if the text entry contains any space characters. :)
Should be this?
Excel Formula:
=SUM(IFERROR(LEFT(B4:B8,FIND(" ",B4:B8))+0,0))
Thank you! That worked. And apologies for posting in the wrong thread.
 
Upvote 0

Forum statistics

Threads
1,223,975
Messages
6,175,749
Members
452,667
Latest member
vanessavalentino83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top