ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Find Fn from right? (https://www.excelbanter.com/excel-worksheet-functions/8195-find-fn-right.html)

mikelee101

Find Fn from right?
 
Hello,
Is there a way to use the Find function, but have it work right to left
instead of left to right? Here's what I'm trying to do, and any help would
be appreciated:

I have a list of domain names, and I'm trying to extract the TLD from each
one. The problem I'm running into is that some of them are 4th level domains
(i.e. ci.dallas.tx.us) and others have TLDs longer than 3 characters (i.e.
domain.info). Here's what I have, and it seems to work, but if there are any
TLDs out there that I'm not thinking of that are longer than 4 characters,
this will error out on me:

=TRIM(RIGHT(A11,LEN(A11)-FIND(".",A11,LEN(A11)-5)))

If anyone knows of a way to just make the FIND start looking on the right,
that would make it simpler and less prone to future errors....

Thanks to all.

Mike



Frank Kabel

Hi
see:
http://www.dicks-blog.com/archives/2...t-2/trackback/

--
Regards
Frank Kabel
Frankfurt, Germany
"mikelee101" schrieb im Newsbeitrag
...
Hello,
Is there a way to use the Find function, but have it work right to left
instead of left to right? Here's what I'm trying to do, and any help
would
be appreciated:

I have a list of domain names, and I'm trying to extract the TLD from each
one. The problem I'm running into is that some of them are 4th level
domains
(i.e. ci.dallas.tx.us) and others have TLDs longer than 3 characters (i.e.
domain.info). Here's what I have, and it seems to work, but if there are
any
TLDs out there that I'm not thinking of that are longer than 4 characters,
this will error out on me:

=TRIM(RIGHT(A11,LEN(A11)-FIND(".",A11,LEN(A11)-5)))

If anyone knows of a way to just make the FIND start looking on the right,
that would make it simpler and less prone to future errors....

Thanks to all.

Mike





Jason Morin

Another alternative:

=RIGHT(A1,MATCH(".",MID(A1,1+LEN(A1)-ROW(INDIRECT("1:"&LEN
(A1))),1),0)-1)

Array-entered.

HTH
Jason
Atlanta, GA

-----Original Message-----
Hello,
Is there a way to use the Find function, but have it

work right to left
instead of left to right? Here's what I'm trying to do,

and any help would
be appreciated:

I have a list of domain names, and I'm trying to extract

the TLD from each
one. The problem I'm running into is that some of them

are 4th level domains
(i.e. ci.dallas.tx.us) and others have TLDs longer than

3 characters (i.e.
domain.info). Here's what I have, and it seems to work,

but if there are any
TLDs out there that I'm not thinking of that are longer

than 4 characters,
this will error out on me:

=TRIM(RIGHT(A11,LEN(A11)-FIND(".",A11,LEN(A11)-5)))

If anyone knows of a way to just make the FIND start

looking on the right,
that would make it simpler and less prone to future

errors....

Thanks to all.

Mike


.


mikelee101

Thanks Frank,
I had done it in VBA, but that slows the calculation down something fierce.
This page is exactly what I'm looking for.

Thanks again.

Mike

"Frank Kabel" wrote:

Hi
see:
http://www.dicks-blog.com/archives/2...t-2/trackback/

--
Regards
Frank Kabel
Frankfurt, Germany
"mikelee101" schrieb im Newsbeitrag
...
Hello,
Is there a way to use the Find function, but have it work right to left
instead of left to right? Here's what I'm trying to do, and any help
would
be appreciated:

I have a list of domain names, and I'm trying to extract the TLD from each
one. The problem I'm running into is that some of them are 4th level
domains
(i.e. ci.dallas.tx.us) and others have TLDs longer than 3 characters (i.e.
domain.info). Here's what I have, and it seems to work, but if there are
any
TLDs out there that I'm not thinking of that are longer than 4 characters,
this will error out on me:

=TRIM(RIGHT(A11,LEN(A11)-FIND(".",A11,LEN(A11)-5)))

If anyone knows of a way to just make the FIND start looking on the right,
that would make it simpler and less prone to future errors....

Thanks to all.

Mike







All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com