Extract data from right between ()

NedZep

New Member
Joined
Apr 24, 2019
Messages
1
I've been trying to pull apart a string into it's parts. I've sorted out some of it, but the last little bit is driving me crazy. Example

CTH KGB01 3.171 (07) (SH) (Scooby Doo)

I need to pull out the Scooby Doo part, and do it for thousands of different lines. The (SH) is not always there, so I can't just use Mid and search for the 3rd (. I need to find from the right, or trim, or something.

Thanks in advance for your expertise! :)
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Please show us a few examples of your data so that we can test appropriately. One record is not enough if the data is not consistent.
 
Upvote 0
Not the prettiest formula....

Excel 2010
AB
1CTH KGB01 3.171 (07) (SH) (Scooby Doo)Scooby Doo

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Array Formulas
CellFormula
B1{=MID(A1,MAX(IF(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)="(",ROW(INDIRECT("1:"&LEN(A1)))))+1,LEN(A1)-1-MAX(IF(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)="(",ROW(INDIRECT("1:"&LEN(A1))))))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Last edited:
Upvote 0
NedZep,

If you're comfortable with UserDefinedFunctions & VB stuff... here's a custom function you could use:
Code:
Function STRREV(ByVal str As String) As String
Dim n&
n = InStrRev(str, "(") + 1
STRREV = Mid(str, n, Len(str) - n)
End Function

Excel 2010
AB
1CTH KGB01 3.171 (07) (SH) (Scooby Doo)Scooby Doo

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
B1=STRREV(A1)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Maybe this formula...

=TRIM(LEFT(RIGHT(SUBSTITUTE(SUBSTITUTE(A1,")","("),"(",REPT(" ",100)),200),100))
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

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