Help with finding numbers within text and summing

  • Thread starter Thread starter wallymeister
  • Start date Start date
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
 
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
 
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
 
Back
Top