Help with finding numbers within text and summing

W

wallymeister

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
 
T

Tom Hutchins

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
 
W

wallymeister

Works great Tom,
Thanks so much.
wallymeister

Tom Hutchins said:
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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top