excel formula need

VBABEGINER

Well-known Member
Joined
Jun 15, 2011
Messages
1,247
Hi,
Good afternoon,

im trying to remove bracket data "(x2)". if a1 contains data in between "()" then the bracket data should be clear and rest data remain in b1.

original
3.5 x 240 mm2 (x2)

after excel formula
3.5 x 240 mm2

note: bracket comes anywhere in data. not fix that will come in last only.

i tried from last half hour but cant. can any one pls suggest...
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try:

=IF(AND(ISNUMBER(SEARCH("(",A1)),ISNUMBER(SEARCH(")",A1))),TRIM(SUBSTITUTE(A1,MID(A1,SEARCH("(",A1),SEARCH(")",A1)-SEARCH("(",A1)+1),"")),A1)

Dom
 
Upvote 0

Excel 2010
AB
13.5 x 240 mm2 (x2)3.5 x 240 mm2
23.5 x 240 (x2)mm23.5 x 240 mm2
33.5 x (234)240 mm23.5 x 240 mm2
43.5 x 240 (agx234)mm23.5 x 240 mm2
53.5 x g0 mm2 (x2)3.5 x g0 mm2
Sheet1
Cell Formulas
RangeFormula
B1=SUBSTITUTE(A1,MID(A1,FIND("(",A1),FIND(")",A1)-FIND("(",A1)+1),"")
 
Upvote 0
Assuming there will only be one bracketed piece of text, give this formula a try...

=TRIM(REPLACE(A1,FIND("(",A1),FIND(")",A1)-FIND("(",A1)+1,""))

If it is possible that there could be no bracketed text, then use this formula instead...

=TRIM(REPLACE(A1,FIND("(",A1&"("),FIND(")",A1&")")-FIND("(",A1&"(")+1,""))
 
Last edited:
Upvote 0
Hi,
Good afternoon,

im trying to remove bracket data "(x2)". if a1 contains data in between "()" then the bracket data should be clear and rest data remain in b1.

original
3.5 x 240 mm2 (x2)

after excel formula
3.5 x 240 mm2

note: bracket comes anywhere in data. not fix that will come in last only.

i tried from last half hour but cant. can any one pls suggest...

Try:

=IF(AND(ISNUMBER(SEARCH("(",A1)),ISNUMBER(SEARCH(")",A1))),TRIM(SUBSTITUTE(A1,MID(A1,SEARCH("(",A1),SEARCH(")",A1)-SEARCH("(",A1)+1),"")),A1)

Dom

Dom: I seem to have a shorter one...

=TRIM(LEFT(A1,FIND("(",A1)-1)&" "&REPLACE(A1,1,FIND(")",A1),""))
 
Upvote 0
@Aladin

I'm not surprised. Thought it was a bit of a monster as I was typing it (although yours will error if the () do not exist I think).

Dom
 
Upvote 0
Dom: I seem to have a shorter one...

=TRIM(LEFT(A1,FIND("(",A1)-1)&" "&REPLACE(A1,1,FIND(")",A1),""))

A touch shorter yet...

=TRIM(LEFT(A1,FIND("(",A1)-1)&MID(A1,FIND(")",A1)+1,999))

And for the case where no bracketed might occur...

=TRIM(LEFT(A1,FIND("(",A1&"(")-1)&MID(A1,FIND(")",A1&")")+1,999))
 
Last edited:
Upvote 0
Afterthought:
Forgot about the TRIM
=TRIM(SUBSTITUTE(A1,MID(A1,FIND("(",A1),FIND(")",A1)-FIND("(",A1)+1),""))
But I'm sure Aladin's and Rick's formulas are the better option.
 
Upvote 0
wow...wowww....
Thanks God,
So many replies from great experts...
Thanks all for discussing on my small part.
This is Honorable for mi.
 
Upvote 0

Forum statistics

Threads
1,221,561
Messages
6,160,495
Members
451,653
Latest member
agata

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
Back
Top