Excel help [Solved/Closed]

Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,

I have an excel worksheet with cells filled with strings of text like this...

CAS [354-24-5], 99%

I'd like to search a vertical column of these types of entries and pull out the number in the brackets and paste into a new cell. The number in brackets will have varying lengths. Here are a few more examples...

CAS [3812236-07-7], 97%
CAS [27639-98-1], 97%
CAS [3110-03-0]

Any help would be most appreciated.

Thanks,
Chris

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
760
Chris, try this

=IF(A1="","",MID(LEFT(A1,IF(ISERROR(FIND("]",A1)),LEN(A1),FIND("]",A1))-1),IF(ISERROR(FIND("[",A1)),1,FIND("[",A1)+1),LEN(A1)))
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2872 users have said thank you to us this month

Hello rizvisa,

Works like a charm. Thank you very much. If you should ever need help with chemistry, look me up. I'm sure ill post again soon.
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
760
Sure thing. next time I am into fluid mechanics or therodynamics, I would sure to look for you :)