Need formula t0 extract # between ()

Russk68

Well-known Member
Joined
May 1, 2006
Messages
596
Office Version
  1. 365
Platform
  1. MacOS
Hello all
I need to extract the number like in the example below.
Between the () is always (#ch).

Before: 16-bit Enhanced (46ch)
After: 46

Thank you!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
with PowerQuery aka Get&transform

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]raw[/td][td][/td][td=bgcolor:#70AD47]Result[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]16-bit Enhanced (46ch)[/td][td][/td][td=bgcolor:#E2EFDA]46[/td][/tr]
[/table]


Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    TBD = Table.AddColumn(Source, "Result", each Text.BetweenDelimiters([raw], "(", "ch"), type text),
    ROC = Table.SelectColumns(TBD,{"Result"})
in
    ROC[/SIZE]
 
Upvote 0
Assuming the first instance of "(" in the string is in "(#ch), copy B1 down.
Excel Workbook
AB
116-bit Enhanced (46ch)46
2(3ch) 32-bit content3
364-bit (128ch) control128
4nothing
Sheet1
 
Upvote 0
Hi,

Another option:


Book1
AB
116-bit Enhanced (46ch)46
232-bit (144ch)144
364-bit (299 not specified)299
4nothing
5(3ch) 32-bit content3
Sheet701
Cell Formulas
RangeFormula
B1=IFERROR(-LOOKUP(1,-LEFT(MID(A1,FIND("(",A1)+1,99),ROW($1:$15))),"")


Change/adjust cell references/range as needed, formula copied down.
 
Upvote 0
If, as JoeMo assumed, the letters after the number are always "ch", then here is another formula you can consider...

=IFERROR(0+MID(LEFT(A1,SEARCH("ch)",A1)-1),FIND("(",A1)+1,99),"")

otherwise use the formula jtakw posted.
 
Last edited:
Upvote 0
Yes. I see some solutions that I am going to try.
Thank you!
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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