ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Help with finding numbers within text and summing (https://www.excelbanter.com/excel-worksheet-functions/213533-help-finding-numbers-within-text-summing.html)

wallymeister

Help with finding numbers within text and summing
 
I have a row of text data that has numbers within brackets, like this [20].

Cells A1:G1 have a combination of numbers and bracketed numbers. Cell J1
has the formula Sum(A1:G1), it adds only the numbers and ignores the text
cells. I want Cell K1 to Sum just the values within the brackets in the same
range.

Can anyone help with this?
Can it be done with formula or will it require VBA Function?

Any help is appreciated
wallymeister

Tom Hutchins

Help with finding numbers within text and summing
 
Try

=SUM(IF(LEN(A1:I1)=0,0,VALUE(SUBSTITUTE(SUBSTITUTE (A1:I1,"[",""),"]",""))))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
and not just Enter. If you do it correctly then Excel will put curly brackets
around the formula {}. You can't type these yourself. If you edit the formula
you must enter it again with CTRL+Shift+Enter.

Hope this helps,

Hutch

"wallymeister" wrote:

I have a row of text data that has numbers within brackets, like this [20].

Cells A1:G1 have a combination of numbers and bracketed numbers. Cell J1
has the formula Sum(A1:G1), it adds only the numbers and ignores the text
cells. I want Cell K1 to Sum just the values within the brackets in the same
range.

Can anyone help with this?
Can it be done with formula or will it require VBA Function?

Any help is appreciated
wallymeister


wallymeister

Help with finding numbers within text and summing
 
Works great Tom,
Thanks so much.
wallymeister

"Tom Hutchins" wrote:

Try

=SUM(IF(LEN(A1:I1)=0,0,VALUE(SUBSTITUTE(SUBSTITUTE (A1:I1,"[",""),"]",""))))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
and not just Enter. If you do it correctly then Excel will put curly brackets
around the formula {}. You can't type these yourself. If you edit the formula
you must enter it again with CTRL+Shift+Enter.

Hope this helps,

Hutch

"wallymeister" wrote:

I have a row of text data that has numbers within brackets, like this [20].

Cells A1:G1 have a combination of numbers and bracketed numbers. Cell J1
has the formula Sum(A1:G1), it adds only the numbers and ignores the text
cells. I want Cell K1 to Sum just the values within the brackets in the same
range.

Can anyone help with this?
Can it be done with formula or will it require VBA Function?

Any help is appreciated
wallymeister



All times are GMT +1. The time now is 04:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com