Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel - remove items in brackets

Status
Not open for further replies.

SQLScholar

Programmer
Joined
Aug 21, 2002
Messages
2,127
Location
GB
hey,

If i had a column as below

product 1 (asdas)
system 2 (a)
prod 3 (2id)

and i wanted to remove anything inside (and including) brackets, so i would get

product 1
system 2
prod 3

Thanks in advance

Dan ----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
 
if there is always a space before the bracket
=LEFT(A1,LEN(A1)-FIND(" ",A1))

else
=LEFT(A1,LEN(A1)-FIND("(",A1))
 
pardon me

didn't realize there were spaces in the data
revised formulas:
if there is always a space before the bracket
=LEFT(A1,LEN(A1)-FIND("(",A1)-1)

else
=LEFT(A1,LEN(A1)-FIND("(",A1))
 
really sleeping this morning....please ignore the above

re-revised formulas:
if there is always a space before the bracket
=LEFT(A1,FIND("(",A1)-1)

else
=LEFT(A1,FIND("(",A1))
 
UPDATE INCASE ANYONE ELSE READS THIS -

Thanks ever so much.... the formular was nearly correct (after i worked out how it worked)

Basically say if the LEN returns 15 characters, and the find says the ( is at 10... then your code will take only the first 5 chars rather then 10. I fiddle with the code and found...

=LEFT(A2,FIND("(",A2)-1)

Works great.

I wouldnt have been able to do it without your code at the start.... thanks.

Dan ----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top