Remove the latter part of a cell contents after a specific string

mmenashe

New Member
Joined
Feb 15, 2011
Messages
23
I have a lot of work to sort through

some sites are:

http://www.example.com

and others are

http://www.example.com/4545cfds6d2

what I want to do is find a way to axe the "/4545cfds6d2" from my column of websites

the common occurence is that all of these have a .com/, whereas the ones I dont have to do anything with are just .com at the end

thanks

Matt

edit, of course its not 454cfds6d2, but a random type of info, so I cant just have it replace that
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Matt
Try
Code:
=LEFT(A1,FIND(".com",A1)+3)
 
Upvote 0
Can you just use find and replace?

Press Control+H to bring up find and replace.

Find: .com*
Replace: .com

This saves time of using a formula and then having to paste it back over your old data. You could probably even record a macro using this too.

Hope that helps.
 
Upvote 0
Michael, youre the man, way to go

actually I came up with a very inelegant solution also, which Ill post here just to add to the stockpile of great answers

I exported that set of data to a .txt file, reimported it with / as the delimiter and then chopped off those last few columns and put it back together

probably the totally wrong way to go about it, but it worked also
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,548
Members
452,927
Latest member
rows and columns

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