Extract a Portion of a URL Using a Formula

langhamc

New Member
Joined
Jun 8, 2011
Messages
5
I have a URL in column A and would like a fromula that extracts a portion of the URL in Column A and puts the results in Column B. In essance I want to extract everthing up to the forth "/" but not including the forth slash. Below is a representation of what I am looking for. Column A has the URL I want to manupulated, Column B has the new URL manipulated by a formula.

Column A
http://abc/sales/pages/home.aspx
http://abc/apps/lists/classified/default view.aspx
http://abc/accounting/pages/home.aspx
http://abc/markenting/pages/home.aspx
http://abc/hr/pages/hr.aspx
http://abc/directory/pages/person.aspx
Column B (results using a formula)
http://abc/sales
http://abc/apps
http://abc/accounting
http://abc/marketing
http://abc/hr
http://abc/directory
Thanks for your help!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Give this formula a try...

=LEFT(A1,FIND("*",SUBSTITUTE(A1,"/","*",4))-1)
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,827
Members
452,946
Latest member
JoseDavid

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