How do I return characters from within brackets?

  • Thread starter Thread starter Acastus
  • Start date Start date
A

Acastus

I have a spreadsheet where column "A" concatenates an product name with
its product number. The product are within brackets, and,
unfortunately, are of varying lengths. Herewith two examples:

PRODUCT 123[R56011]
PRODUCT 45678[5065]

What I need to do is create a column "B" that only has the SKU number.
This will allow me to use the VLOOKUP function to match data in other
columns based on the unique SKU number with data in another sheet.
Specifically, the column "B" data for the two examples above should
look like:

R56011
5065

I can't program on my own, but is there a command or function that will
allow me to instruct excel to take only the characters between those
brackets and put it in the adjacent cell in column B, regardless of the
number of characters between the brackets?

If anyone has advice, it'd be great!
 
Try something like this:

For a value in A1

B1: =MID(A1,SEARCH("[",A1)+1,SEARCH("]",A1)-SEARCH("[",A1)-1)

Example:
A1: PRODUCT 123[R56011]
B1: returns R56011

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 
I have a spreadsheet where column "A" concatenates an product name with
its product number. The product are within brackets, and,
unfortunately, are of varying lengths. Herewith two examples:

PRODUCT 123[R56011]
PRODUCT 45678[5065]

What I need to do is create a column "B" that only has the SKU number.
This will allow me to use the VLOOKUP function to match data in other
columns based on the unique SKU number with data in another sheet.
Specifically, the column "B" data for the two examples above should
look like:

R56011
5065

I can't program on my own, but is there a command or function that will
allow me to instruct excel to take only the characters between those
brackets and put it in the adjacent cell in column B, regardless of the
number of characters between the brackets?

If anyone has advice, it'd be great!

If the only brackets are those surrounding the Product Number, then:

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

should do it.
--ron
 
Bless you both! Yes, both work fine. Thanks again - it really saved me
a HUGE amount of crap work!
 
Back
Top