![]() |
How do I return characters from within brackets?
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! |
How do I return characters from within brackets?
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 "Acastus" wrote: 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! |
How do I return characters from within brackets?
On 29 Jul 2006 12:07:49 -0700, "Acastus" wrote:
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 |
How do I return characters from within brackets?
Bless you both! Yes, both work fine. Thanks again - it really saved me
a HUGE amount of crap work! |
How do I return characters from within brackets?
On 29 Jul 2006 14:24:33 -0700, "Acastus" wrote:
Bless you both! Yes, both work fine. Thanks again - it really saved me a HUGE amount of crap work! You're welcome. Thanks for the feedback. --ron |
All times are GMT +1. The time now is 08:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com