sbwcws
sbwcws

Reputation: 165

Excel Formula to remove everything from our URL after 2019

I've a list of URL for example

https://www.example.com/test/myurl/2019-11-20T10:09:25-05:00

What I want is to remove the 2019-11-20T10:09:25-05:00

I just need the URL on the left separated out BUT Please note the year, date and time is different on all URL for example

2019-11-19T13:48:46-05:00 2019-11-19T13:40:40-05:00 2019-11-19T13:38:56-05:00

The final result i need in EXCEL after formula is

https://www.example.com/test/myurl/

I am not sure how to achieve that - Thanks.

Upvotes: 0

Views: 30

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521457

We can try finding the index of the final occurrence of the path separator /, and then use LEFT to take the appropriate substring:

=LEFT(A1, FIND("@",SUBSTITUTE(A1,"/","@",LEN(A1)-LEN(SUBSTITUTE(A1,"/",""))),1))

Assuming that cell A1 contains:

https://www.example.com/test/myurl/2019-11-20T10:09:25-05:00

then the output of the above formula would be:

https://www.example.com/test/myurl/

Upvotes: 1

Related Questions