Can anyone explain this formula: =LEFT(A2,SEARCH("/",A2,8))

Pingbat

New Member
Joined
Jun 20, 2016
Messages
20
Hi Guys from York, UK,

The below table shows the effect of this formula:
=LEFT(A2,SEARCH("/",A2,8))

Love it in that it does what i want, strips a UTL down to a root but I just copied off the internet. Can anyone explain to my how it works?

Thanks in advance,
David





[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 925"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]URL[/TD]
[TD]Root Domain[/TD]
[/TR]
[TR]
[TD]http://www.seomoz.org/article/search-ranking-factors[/TD]
[TD]http://www.seomoz.org/[/TD]
[/TR]
[TR]
[TD]http://www.toprankblog.com/search-marketing-blogs/[/TD]
[TD]http://www.toprankblog.com/[/TD]
[/TR]
[TR]
[TD]http://www.bdadyslexia.org.uk/[/TD]
[TD]http://www.bdadyslexia.org.uk/[/TD]
[/TR]
[TR]
[TD]http://www.davidmihm.com/local-search-ranking-factors.shtml[/TD]
[TD]http://www.davidmihm.com/[/TD]
[/TR]
[TR]
[TD]http://wiep.net/[/TD]
[TD]http://wiep.net/[/TD]
[/TR]
[TR]
[TD]http://www.searchenginejournal.com/101-tactics-buy-text-links/13578/[/TD]
[TD]http://www.searchenginejournal.com/[/TD]
[/TR]
[TR]
[TD]http://searchengineland.com/how-to-segment-google-website-optimizer-tests-33341[/TD]
[TD]http://searchengineland.com/[/TD]
[/TR]
[TR]
[TD]http://www.techipedia.com/2009/internet-marketing-posts-2008/[/TD]
[TD]http://www.techipedia.com/[/TD]
[/TR]
[TR]
[TD]http://www.problogger.net/archives/2007/10/02/the-54000-problogger-giveaway-prizes-and-sponsors/[/TD]
[TD]http://www.problogger.net/[/TD]
[/TR]
</tbody>[/TABLE]

[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
The search function looks for the first / starting a character 8 (so it ignores the first two //) & returns its position in the string.
the left function then takes the left x number of characters of the string, where x is the number returned by the search
 
Upvote 0
Search finds the numeric position of the first "/" after the 8th character (so ignoring the http:// or https:// in each case) of the URL string.

That is being passed to the function "Left" which returns the left hand side of a string, up to a specified number of characters (in this case case, specified by the result of the search).

In simple terms its returning the left hand side of a string up to the first (non ignored) instance of "/"
 
Upvote 0
The search function looks for the first / starting a character 8 (so it ignores the first two //) & returns its position in the string.
the left function then takes the left x number of characters of the string, where x is the number returned by the search

Thanks @Fluff :-)
 
Upvote 0
Search finds the numeric position of the first "/" after the 8th character (so ignoring the http:// or https:// in each case) of the URL string.

That is being passed to the function "Left" which returns the left hand side of a string, up to a specified number of characters (in this case case, specified by the result of the search).

In simple terms its returning the left hand side of a string up to the first (non ignored) instance of "/"

Big thank you @ScottR :-)
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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