Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to split text in Google Sheets by searching exact word?

I have a text Ahimsa Industries Ltd (NSE:AHIMSA) in the cell A30.

I need to split/find NSE:AHIMSA and Name Ahimsa Industries Ltd.

I have created a formula to split text is =SPLIT(A30, "NSE:")

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I expected result as "Ahimsa Industries Ltd (" and "NSE:AHIMSA)"

After that I have used formula

=LEFT(I30,LEN(I30)-1) to get result as "Ahimsa Industries Ltd"
And =LEFT(J30,LEN(J30)-1) to get result as AHIMSA. But I am not getting the expected result. So kindly help me.

>Solution :

You can use REGEXEXTRACT, like this:

=REGEXEXTRACT(A30,"(.+) \((.+)\)")

Another solution using SPLIT

=SPLIT(SPLIT(A30,")")," (",0) 
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading