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

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
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]

ListList
12345_ab.A.IFI.pdf12345_ab.A.IFI
2432423.B.IFI.xlsm2432423.B.IFI
 
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,214,573
Messages
6,120,310
Members
448,955
Latest member
Dreamz high

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