Extract text after two identical characters

dininaus

New Member
Joined
Jul 27, 2016
Messages
22
Hi All,

Probably simple I just cant figure it out how to do it, could someone please help me

I have column with filenames containing revision, status and format. I would like to extract all information except the file format. An example as below:

12345_ab.A.IFI.pdf
2432423.B.IFI.xlsm

I need to extract values as below

12345_ab.A.IFI
2432423.B.IFI

Thanks in advance.



 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
One way:

=LEFT(A1,SEARCH("^^^",SUBSTITUTE(A1".";"^^^",3))-1)
 
Upvote 0
with PowerQuery (Get&Transform)

Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    ExtractBD = Table.TransformColumns(Source, {{"List", each Text.BeforeDelimiter(_, ".", {0, RelativePosition.FromEnd}), type text}})
in
    ExtractBD[/SIZE]

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

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]12345_ab.A.IFI.pdf[/td][td][/td][td=bgcolor:#E2EFDA]12345_ab.A.IFI[/td][/tr]

[tr=bgcolor:#FFFFFF][td]2432423.B.IFI.xlsm[/td][td][/td][td]2432423.B.IFI[/td][/tr]
[/table]
 
Upvote 0
Tom.Jones's suggestion

=LEFT(A2,SEARCH("^^^",SUBSTITUTE(A2,".","^^^",3))-1)

expects 3 dots in the input string.

Another option is control+shift+enter, not just enter, and copy down:

=LEFT(A2,MATCH(9.99999999999999E+307,MATCH(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1),{"."},0))-1)
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,025
Members
452,542
Latest member
Bricklin

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