+ Reply to Thread
Results 1 to 17 of 17

FQDN name strip with formula

  1. #1
    Registered User
    Join Date
    09-23-2022
    Location
    New York, New York
    MS-Off Ver
    16.66
    Posts
    9

    FQDN name strip with formula

    Hello all,

    I have an excel sheet with about 50K rows that have hostnames with FQDNs. I'm looking for a formula to strip down FQDN's with exception of IP addresses.

    Real examples:

    Column A

    10.10.10.10
    hostname1-P.test.com
    hostname2.test.edu
    hostname1.rc.test.org

    In column B I want:

    10.10.10.10
    hostname1-P
    hostname2
    hostname1.rc


    How I can accomplish this?

    Thanks in advance

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: FQDN name strip with formula

    what is a FQDNs?

    Please read the yellow banner at the top and upload a sample WB
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: FQDN name strip with formula

    One way:

    See formula in FILE, as forum software did NOT render it correctly here.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    09-23-2022
    Location
    New York, New York
    MS-Off Ver
    16.66
    Posts
    9

    Re: FQDN name strip with formula

    It means "Fully Qualified Domain Name"
    Last edited by AliGW; 09-24-2022 at 09:21 AM. Reason: Please DON'T quote unnecessarily!

  5. #5
    Registered User
    Join Date
    09-23-2022
    Location
    New York, New York
    MS-Off Ver
    16.66
    Posts
    9

    Re: FQDN name strip with formula

    Quote Originally Posted by Glenn Kennedy View Post
    One way:

    See formula in FILE, as forum software did NOT render it correctly here.
    This works like magic Glenn! I appreciate it so much.

    Also, curious, how did you become this good at Excel? I want to learn!

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: FQDN name strip with formula

    I learned most of it right here!

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

  7. #7
    Registered User
    Join Date
    09-23-2022
    Location
    New York, New York
    MS-Off Ver
    16.66
    Posts
    9

    Re: FQDN name strip with formula

    Hi Glenn.

    How can I return the actual values of the servers instead of #VALUE where there is no domain name to strip?

    For example, some hostnames don't have anything to strip but they return #VALUE in the results. How can I display their names regardless?

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: FQDN name strip with formula

    A guess, as no specific example was provided.

    See file.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-23-2022
    Location
    New York, New York
    MS-Off Ver
    16.66
    Posts
    9

    Re: FQDN name strip with formula

    Quote Originally Posted by Glenn Kennedy View Post
    A guess, as no specific example was provided.

    See file.
    Hello Glen. Thanks again. This works as well. Turns out that I need to remove hostname1.rc.test.org to hostname1 as well. So I am assuming this formula would work?

    =IFERROR(IF(ISERROR(LEFT(A2,3)+0),LEFT(A2,FIND(".",A2)-1),A2),A2)

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: FQDN name strip with formula

    Away for a few hours. Please upload a fresh sample that covers all scenarios and includes expected answers.

  11. #11
    Registered User
    Join Date
    09-23-2022
    Location
    New York, New York
    MS-Off Ver
    16.66
    Posts
    9

    Re: FQDN name strip with formula

    Quote Originally Posted by Glenn Kennedy View Post
    Away for a few hours. Please upload a fresh sample that covers all scenarios and includes expected answers.
    Hi Glenn. Thanks for helping. Attached is expected results marked in yellow exmaple of results.xlsx

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: FQDN name strip with formula

    Then use:

    =IF(A2="","",IFERROR(IF(ISNUMBER(SUBSTITUTE(A2,".","")+0),A2,LEFT(A2,SEARCH(".",A2)-1)),D2))
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-23-2022
    Location
    New York, New York
    MS-Off Ver
    16.66
    Posts
    9

    Re: FQDN name strip with formula

    Quote Originally Posted by Glenn Kennedy View Post
    Then use:

    =IF(A2="","",IFERROR(IF(ISNUMBER(SUBSTITUTE(A2,".","")+0),A2,LEFT(A2,SEARCH(".",A2)-1)),D2))
    Thank you Glen. I appreciate it. I'll use the formulas provided when necessary.

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: FQDN name strip with formula

    You're welcome.

  15. #15
    Registered User
    Join Date
    09-23-2022
    Location
    New York, New York
    MS-Off Ver
    16.66
    Posts
    9

    Re: FQDN name strip with formula

    Quote Originally Posted by Glenn Kennedy View Post
    Then use:

    =IF(A2="","",IFERROR(IF(ISNUMBER(SUBSTITUTE(A2,".","")+0),A2,LEFT(A2,SEARCH(".",A2)-1)),D2))
    -------------

    Sorry Glenn but I think I am missing something here.

    With this formula you provided: =IF($A2="","",IF(ISNUMBER(SUBSTITUTE($A2,".","")+0),$A2,LEFT($A2,SEARCH("?",SUBSTITUTE($A2,".","?",LEN($A2)-LEN(SUBSTITUTE($A2,".",""))-1))-1)))

    I got these results:

    Column A (original data)

    10.10.10.10
    hostname1.test.org
    hostname1.rc.test.org
    hostname1

    Column B (results of formula)

    10.10.10.10
    hostname1
    hostname1
    #VALUE!

    I would like this if possible:

    hostname1
    hostname1.rc
    hostname1

    I don't think any of the formulas return said results? Let me know.

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: FQDN name strip with formula

    Did you open the file at my last post????

    It delivers the correct result for BOTH scenarios. Unless there's something you haven't told me about.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    09-23-2022
    Location
    New York, New York
    MS-Off Ver
    16.66
    Posts
    9

    Re: FQDN name strip with formula

    Quote Originally Posted by Glenn Kennedy View Post
    Did you open the file at my last post????

    It delivers the correct result for BOTH scenarios. Unless there's something you haven't told me about.
    Yes, we are all good. I didn't realize that the other column had the results as well.

    Now I am finally good and thank you again for all the help. I really appreciate it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Strip excess data from text using a formula
    By robertguy in forum Excel General
    Replies: 3
    Last Post: 05-02-2017, 06:55 AM
  2. [SOLVED] Formula to strip hipen in between numbers
    By rizmomin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-08-2017, 03:35 PM
  3. Looking for help on a formula/function that can do a dynamic strip of a value
    By TheRock_82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-27-2015, 10:12 AM
  4. [SOLVED] FQDN to short name if applicable
    By TommyGun in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-10-2015, 09:54 AM
  5. [SOLVED] Need some quick help with pinging a list of machine names with FQDN
    By mdwbeex in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2015, 09:07 AM
  6. Formula to strip leading articles
    By Tiktock in forum Excel General
    Replies: 4
    Last Post: 10-19-2010, 08:10 PM
  7. Formula to strip figures from cells text strings
    By mikeburg in forum Excel General
    Replies: 5
    Last Post: 08-15-2005, 09:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1