Removing everything outside brackets in a cell

justin_n84

Board Regular
Joined
Jan 29, 2017
Messages
56
Hi!!

I have a bunch of cells which contain data similar to "[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]0.120 (3.048)". I want to delete everything out side the brackets. Is there an easy way to do this?

Thanks in advance
[/FONT]
 

Some videos you may like

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115
Here's one way.

Assumptions
1) Your input data begins in cell A1.
2) Each input contains one, and ONLY one, instance of the "(" character. So never 2 or 3 of these, and they are never entirely absent.
3) Same as (2) for the ")" character.

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

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
1,054
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hi there. You can do it with 2 replaces. First, replace "*(" with nothing (leave the replace text blank). The replace ")*" in the same way. If you are wanting to do this many times, just record yourself doing it into a macro.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,107
Office Version
  1. 365
Platform
  1. Windows
Another option
=IFERROR(SUBSTITUTE(REPLACE(A2,1,FIND("(",A2),""),")","")*1,A2)
 

Gerald Higgins

Well-known Member
Joined
Mar 26, 2007
Messages
9,115

ADVERTISEMENT

Minor comment - my solution leaves the brackets in place, Fluff's and jamcleary's remove them.

All of the solutions can be adapted to either remove them or leave them.
 

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
1,054
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Another minor comment - my solution replaces the data in situ, both the others require the formula to be in a separate cell. If you want to keep the brackets my solution can be modified the use a replace value of "(" for the first, and ")" for the second. (rereading your original post, that's what you wanted I think).
 

justin_n84

Board Regular
Joined
Jan 29, 2017
Messages
56

ADVERTISEMENT

so do a replace using "**"?

If so this deletes everything in the cell....

If not can you please show exactly as it needs to be typed?

Thanks
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,107
Office Version
  1. 365
Platform
  1. Windows
It needs to be *(
& leave the Replace box blank, or if you want to keep the brackets put a ( in the replace box
 
Last edited:

justin_n84

Board Regular
Joined
Jan 29, 2017
Messages
56
Yes I am sure. But I may be doing it incorrectly. So if you could show me exactly what to type in that would be much appreciated. Consider me an absolute beginner to excel..... ;)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,891
Messages
5,598,680
Members
414,254
Latest member
MarieCo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top