I need to extract text from a long text field

Jeffrey Green

Well-known Member
Joined
Oct 24, 2007
Messages
1,021
Sample data from a cell - I have thousands of rows, same format . . .</SPAN>

ERROR: Transaction Num (1135653-EPKTA-38-054919000): Version Num (1.0): Invoice Num (1J12323-EPKTA): Product ID (CT16-V04100-ABN4C6): Supplier (EPKTA): The Unit value on the CRI line item is missing. </SPAN>

I only need that Product ID, and disregard the rest!

I would prefer something to extract ONLY whatever lies between the ( and the ) following the words Product ID.

This report is system generated and always follows the same format.

It would be ok to remove unwanted text from within the same column, or maybe even better, to insert the extracted text into the adjacent column.

I can move that column to Column A if needed, etc.

Any suggestions?</SPAN>
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
With text to collumn I get (CT16-V04100-ABN4C6) in collumn M.

If you have data similar to that, you can delete the not wanted collumns.
 
Upvote 0
Try

=MID(A1,FIND("Product ID",A1)+12,FIND(")",A1,FIND("Product ID",A1)+12)-(FIND("Product ID",A1)+12))
 
Upvote 0
Alternate:

=TRIM(MID(SUBSTITUTE(MID(A1,FIND("(",A1,SEARCH("product id",A1))+1,99),")",REPT(" ",99)),1,99))
 
Upvote 0
Sample data from a cell - I have thousands of rows, same format . . .</SPAN>

ERROR: Transaction Num (1135653-EPKTA-38-054919000): Version Num (1.0): Invoice Num (1J12323-EPKTA): Product ID (CT16-V04100-ABN4C6): Supplier (EPKTA): The Unit value on the CRI line item is missing. </SPAN>

I only need that Product ID, and disregard the rest!

I would prefer something to extract ONLY whatever lies between the ( and the ) following the words Product ID.

This report is system generated and always follows the same format.

It would be ok to remove unwanted text from within the same column, or maybe even better, to insert the extracted text into the adjacent column.

I can move that column to Column A if needed, etc.

Any suggestions?</SPAN>
Is the number of characters within the (...) always the same?

Product ID (CT16-V04100-ABN4C6)

CT16-V04100-ABN4C6 = 18 characters
 
Upvote 0

Forum statistics

Threads
1,203,686
Messages
6,056,737
Members
444,888
Latest member
Babi_mn

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