ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copy Text String from between () (https://www.excelbanter.com/excel-worksheet-functions/155330-copy-text-string-between.html)

[email protected]

Copy Text String from between ()
 
A simple one hopefully, I am trying to FIND a text string which always
occurs between brackets and copy it into another column.

Example, I want to copy the word "Apples" from cell A1 to cell B1
where A1 has the following Text :

Peaches Cream (Apples) Bannana Cherries.

Many thanks for any help


Duke Carey

Copy Text String from between ()
 
try

=MID(A1,FIND("(",A1,1)+1,FIND(")",A1,1)-FIND("(",A1,1)-1)

" wrote:

A simple one hopefully, I am trying to FIND a text string which always
occurs between brackets and copy it into another column.

Example, I want to copy the word "Apples" from cell A1 to cell B1
where A1 has the following Text :

Peaches Cream (Apples) Bannana Cherries.

Many thanks for any help



Pete_UK

Copy Text String from between ()
 
With your string in A1, use this formula:

=IF(ISERROR(MID(A1,SEARCH("(",A1)+1,SEARCH(")",A1)-
SEARCH("(",A1)-1)),"",MID(A1,SEARCH("(",A1)+1,SEARCH(")",A1)-
SEARCH("(",A1)-1))

All one formula - be wary of spurious line-breaks on the newsgroups.

If you do not have either an opening or closing bracket, or if your
closing bracket occurs before the opening bracket, then you will get a
blank cell.

Hope this helps.

Pete

On Aug 22, 2:36 pm, wrote:
A simple one hopefully, I am trying to FIND a text string which always
occurs between brackets and copy it into another column.

Example, I want to copy the word "Apples" from cell A1 to cell B1
where A1 has the following Text :

Peaches Cream (Apples) Bannana Cherries.

Many thanks for any help





All times are GMT +1. The time now is 11:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com