We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Excel String Handling
Options

lr1277
Posts: 2,131 Forumite


in Techie Stuff
Hi. I am looking for help with the following as I have been going around in circles. In column A I might have something like the following:
Astrazeneca (AZN)
Mustang Energy (MUST)
In column B, I would like to see just the stock ticker of AZN or MUST, respectively.
I have been trying mid, left, right, find, if.
How would you extract the stock ticker from the above strings?
Many thanks in advance.
0
Comments
-
=FIND("(",A1) will find the position of the first (
add one to that to find the first letter of the tracker string, (call that y, for now)
assuming that the string is always the first three letters, then =(Mid(a1,y,3) returns the string
to combine all that in one formula
=MID(A1,((FIND("(",A1))+1),3)
0 -
sorry, just re read it
if the string in the brackets isn't always three characters
use =find again to find the location of the )
subtract the position of the ( from the position of the ) to get the length of what's inside the brackets (actually, subtract another 1 from it)
then you're replacing the final 3 in the =MID statement in the post above with the actual length of the string.
or all combined:
=MID(A1,((FIND("(",A1))+1),(((FIND(")",A1))-(FIND("(",A1))))-1)
2 -
KingL2 said:sorry, just re read it
if the string in the brackets isn't always three characters
use =find again to find the location of the )
subtract the position of the ( from the position of the ) to get the length of what's inside the brackets (actually, subtract another 1 from it)
then you're replacing the final 3 in the =MID statement in the post above with the actual length of the string.
or all combined:
=MID(A1,((FIND("(",A1))+1),(((FIND(")",A1))-(FIND("(",A1))))-1)
0 -
yeah, if it's not clear from the above, the
Length is [position of closing bracket]-[position of opening bracket]-1
HTH
1 -
Ahh, thank you. I understand.
0
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.8K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.8K Work, Benefits & Business
- 598.7K Mortgages, Homes & Bills
- 176.8K Life & Family
- 257.1K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards