+ Reply to Thread
Results 1 to 10 of 10

extract parentheses or extract word without parentheses and check two IP subnet ranges

  1. #1
    Registered User
    Join Date
    09-20-2010
    Location
    islamabad
    MS-Off Ver
    Excel 2019
    Posts
    83

    extract parentheses or extract word without parentheses and check two IP subnet ranges

    I have a column in sheet that contains three common information , two IP ranges , Hostname under parentheses and hostnames without parentheses

    10.164.29.38
    10.179.14.99
    ::1 (EXECUTIONSCHEDU)
    10.179.5.171 (Teslaable-dms-ns)
    10.179.6.152 (DMX-D42WDS.org.gov.local)
    10.161.0.13
    10.179.6.152 (DMX-D42WDS.org.gov.local)
    10.169.3.122 (RPG-DC3-A1P-E5W32)


    I am currently using two different formula to calculate , if text is in parentheses copy to new column and another forumula that calcuate two IP subnets and display results if its from a Fortinet VPN range. I wanted to run both forumla with If then else logic that if parentheses is present copy data and if IP range is there type it as Fortinet VPN.

    Can I do it gurus?

    this forumla is working fine for capturing text under parentheses

    =IFERROR(MID(Z2, SEARCH("(", Z2)+1, SEARCH(")",Z2)-SEARCH("(",Z2)-1),"")

    second formula in another column to check two subnets if any IP falls unders that range it display type as Fortinet VPN , I want to keep this condition +above together excel to generate the result

    =IF(OR(ISNUMBER(SEARCH("10.179.26",Z2)),ISNUMBER(SEARCH("10.179.27",Z2))),"Fortinet VPN","")

    can you guys help ?
    Attached Files Attached Files
    Last edited by esaji; 04-13-2020 at 06:24 AM. Reason: need to upload attachement

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: extract parentheses or extract word witout parentheses and third condition

    Thank you for opening your own thread.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-20-2010
    Location
    islamabad
    MS-Off Ver
    Excel 2019
    Posts
    83

    Re: extract parentheses or extract word witout parentheses and third condition

    thanks for guiding aliGW I have uploaded the sample attachement with forumulaz

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: extract parentheses or extract word without parentheses and check two IP subnet range

    Is this what you are looking for?

    =IFERROR(MID(A2, SEARCH("(", A2)+1, SEARCH(")",A2)-SEARCH("(",A2)-1),IF(OR(ISNUMBER(SEARCH("10.179.26",A2)),ISNUMBER(SEARCH("10.179.27",A2))),"Fortinet VPN",""))

  5. #5
    Registered User
    Join Date
    09-20-2010
    Location
    islamabad
    MS-Off Ver
    Excel 2019
    Posts
    83

    Re: extract parentheses or extract word without parentheses and check two IP subnet range

    yes almost , thanks for the quick response so only one thing its missing is if the hostname is not there IP should be pasted , currently its skipping IP address

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: extract parentheses or extract word without parentheses and check two IP subnet range

    OK - please provide a copy of the workbook with a manually created column showing the answers you want. This was missing from your earlier attachment.

    Wait - maybe this?

    =IFERROR(MID(A2,SEARCH("(",A2)+1,SEARCH(")",A2)-SEARCH("(",A2)-1),IF(OR(ISNUMBER(SEARCH("10.179.26",A2)),ISNUMBER(SEARCH("10.179.27",A2))),"Fortinet VPN",A2))
    Last edited by AliGW; 04-13-2020 at 06:45 AM.

  7. #7
    Registered User
    Join Date
    09-20-2010
    Location
    islamabad
    MS-Off Ver
    Excel 2019
    Posts
    83

    Re: extract parentheses or extract word without parentheses and check two IP subnet range

    I think this make it fixed

    =IFERROR(MID(A2, SEARCH("(", A2)+1, SEARCH(")",A2)-SEARCH("(",A2)-1),IF(OR(ISNUMBER(SEARCH("10.179.26",A2)),ISNUMBER(SEARCH("10.179.27",A2))),"Fortinet VPN",A2))

    as fortinet VPN side of condition was copying empty value (for VALUE#) error , so I just replaced with A2 to bring IP here as there is no empty data in this column

    thanks for the help

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: extract parentheses or extract word without parentheses and check two IP subnet range

    Yes, that's what I've just suggested above!!!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  9. #9
    Registered User
    Join Date
    09-20-2010
    Location
    islamabad
    MS-Off Ver
    Excel 2019
    Posts
    83

    Re: extract parentheses or extract word without parentheses and check two IP subnet range

    Quote Originally Posted by AliGW View Post
    Yes, that's what I've just suggested above!!!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Can I ask one more query realted to this the column contains these values as well Multiple(80) sometime local (8) and Remote(180) how i can get them in by adding third condition check ? I tired this to add in the existing query but its giving me error

    =IF(OR(ISNUMBER(SEARCH("Multiple",A4)),ISNUMBER(SEARCH("local",A4))),A4),ISNUMBER(SEARCH("Remote",A4))),A4) - i will be glad if you can help

  10. #10
    Registered User
    Join Date
    09-20-2010
    Location
    islamabad
    MS-Off Ver
    Excel 2019
    Posts
    83

    Re: extract parentheses or extract word without parentheses and check two IP subnet range

    Can I used the same forumula to find third IP range ?
    10.179.28
    as below is not working for me ?
    =IFERROR(MID(Z2, SEARCH("(", Z2)+1, SEARCH(")",Z2)-SEARCH("(",Z2)-1),IF(OR(ISNUMBER(SEARCH("10.179.26",Z2)),ISNUMBER(SEARCH("10.179.27",Z2))),ISNUMBER(SEARCH("10.179.28",Z2)))),"Fortinet VPN",Z2))

+ 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. Extract Text in Parentheses From One Cell to Another
    By Dhyre in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 04-13-2020, 04:10 AM
  2. [SOLVED] Extract text between specific string and closing parentheses
    By The Molecular Level in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-10-2019, 05:53 PM
  3. [SOLVED] Extract text from between nth set of parentheses?
    By The Molecular Level in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2019, 11:38 AM
  4. [SOLVED] how to extract data from strings containing multiple parentheses?
    By dvess11 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-25-2019, 07:31 PM
  5. [SOLVED] Extract All characters between sets of parentheses to adjacent cell
    By MusicMan in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-24-2018, 05:18 AM
  6. [SOLVED] How to extract text between brackets/parentheses in Excel?
    By chief_abound in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-19-2015, 05:12 AM
  7. How to extract text in between LAST set of parentheses?
    By kioken in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-27-2015, 02:08 PM

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