(Mods feel free to move the post, as it could be getting into a solution mode here)
For instance, I may be wrong, but...from what i can see, that formula could be replaced by this one:
Code:
=TRIM(RIGHT(SUBSTITUTE(LEFT(A1,FIND("/",SUBSTITUTE(A1,"://","|||"))-1),".",REPT(" ",LEN(A1)),1),LEN(A1)))
Sorry, I didn't provide enough context as to the original requirement, as the "long" formula actually does the job most of the time. The problem is identifying a "domain", which in an SEO context becomes a looser definition than the strict one used by domain sellers.
The idea is to extract the
unique domain part of the URL. For a top-level domain (TLD) of ".com", such as hxxp://www.example.com/blah/blah, we need to extract "example.com". For a country code TLD (ccTLD) of ".com.au", such as hxxp://blah.example.com.au/blah/blah we need to extract "example.com.au" (http changed to hxxp)
So I imagine the author kept on building the formula to cover all the odd examples that popped up. That's why I saw it as a complex problem. Your elegant formula written without any context (hence not a criticism) doesn't catch the tricky ones and I can't see some of the differences, e.g. a leading number breaks it, but it's not always the same number:
[TABLE="class: grid, width: 500, align: left"]
[TR]
[TD]
URL
[/TD]
[TD]
Long[/TD]
[TD]
Elegant
[/TD]
[/TR]
[TR]
[TD]hxxp://01example.com/auto_insurance_info.htm[/TD]
[TD]01example.com[/TD]
[TD]com[/TD]
[/TR]
[TR]
[TD]hxxp://0772.1example.com/%E6%BE%B3%E5%A4%A7%E5%88%A9%E4%BA%9A%E7%BD%91%E5%9D%80%E5%A4%A7%E5%85%A8/[/TD]
[TD]01example.com[/TD]
[TD]com[/TD]
[/TR]
[TR]
[TD]hxxp://0777.1example.com/%E6%BE%B3%E5%A4%A7%E5%88%A9%E4%BA%9A%E7%BD%91%E5%9D%80%E5%A4%A7%E5%85%A8/[/TD]
[TD]1example.com[/TD]
[TD]1example.com[/TD]
[/TR]
[TR]
[TD]hxxp://0796.1example.com/%E6%BE%B3%E5%A4%A7%E5%88%A9%E4%BA%9A%E7%BD%91%E5%9D%80%E5%A4%A7%E5%85%A8/[/TD]
[TD]1example.com[/TD]
[TD]1example.com[/TD]
[/TR]
[TR]
[TD]hxxp://1001example.net/travel/australia/index.html[/TD]
[TD]1001example.net[/TD]
[TD]net[/TD]
[/TR]
[TR]
[TD]hxxp://1001example.net/travel/australia/south_pacific.html[/TD]
[TD]1001example.net[/TD]
[TD]net[/TD]
[/TR]
[TR]
[TD]hxxp://1234example.com/car-insurance-quotes/Comprehensive-auto-insurance.htm[/TD]
[TD]1234example.com[/TD]
[TD]com[/TD]
[/TR]
[TR]
[TD]hxxp://3points.example.co.uk/car-insurance-how-many-work-weeks-in-a-year-united-states/[/TD]
[TD]example.co.uk[/TD]
[TD]example.co.uk[/TD]
[/TR]
[TR]
[TD]hxxp://5www.example.com/how-big-is-one-acre-in-square-meters/[/TD]
[TD]example.com[/TD]
[TD]example.com[/TD]
[/TR]
[TR]
[TD]hxxp://61example.com/url/662/hxxp://www.example.com.au/business-insurance/[/TD]
[TD]61example.com
[/TD]
[TD]com[/TD]
[/TR]
[TR]
[TD]hxxp://99example.com.au/other-business-advertising/contests/create-infographic-cover-travel-insurance-australia-287951[/TD]
[TD]99example.com.au
[/TD]
[TD]com.au[/TD]
[/TR]
[TR]
[TD]hxxp://99example.com.au/other-business-advertising/contests/create-infographic-cover-travel-insurance-australia-287951/brief[/TD]
[TD]99example.com.au[/TD]
[TD]com.au[/TD]
[/TR]
[TR]
[TD]hxxp://99example.com.au/other-business-advertising/contests/create-infographic-cover-travel-insurance-australia-287951/overview[/TD]
[TD]99example.com.au[/TD]
[TD]com.au[/TD]
[/TR]
[TR]
[TD]hxxp://9example.com/alphameric/t?p=261[/TD]
[TD]9example.com[/TD]
[TD]com[/TD]
[/TR]
[TR]
[TD]hxxp://9example.com/Business/Insurance/?p=10[/TD]
[TD]9example.com[/TD]
[TD]com[/TD]
[/TR]
[TR]
[TD]hxxp://9example.com/Business/Insurance/?p=11[/TD]
[TD]9example.com[/TD]
[TD]com[/TD]
[/TR]
[TR]
[TD]hxxp://9example.com/listing/Business/Insurance/travel-insurance-direct-7005[/TD]
[TD]9example.com[/TD]
[TD]com[/TD]
[/TR]
[TR]
[TD]hxxp://example.com.au/[/TD]
[TD]example.com.au[/TD]
[TD]com.au[/TD]
[/TR]
[TR]
[TD]hxxp://aca.example.com.au/article/8869484/no-more-loyalty-in-insurance[/TD]
[TD]example.com.au[/TD]
[TD]example.com.au[/TD]
[/TR]
[TR]
[TD]hxxp://example.com.au/?pg=1[/TD]
[TD]example.com.au[/TD]
[TD]com.au[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[/TABLE]