+ Reply to Thread
Results 1 to 11 of 11

Invert list of IP addresses

  1. #1
    Registered User
    Join Date
    04-18-2016
    Location
    Belgium
    MS-Off Ver
    2013
    Posts
    4

    Invert list of IP addresses

    Hi

    I have an ordered list of 2580 IP addresses that are in use in 18 /24 subnets (total of 4608 addresses). I want to inverse this list and get the list of IP addresses that are not in use.

    Anyone has an idea?

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Invert list of IP addresses

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window (or use the paperclip icon).
    Cheers!
    Deep Dave

  3. #3
    Registered User
    Join Date
    04-18-2016
    Location
    Belgium
    MS-Off Ver
    2013
    Posts
    4

    Re: Invert list of IP addresses

    Thanks for your quick reply, I have attached a sample workbook.

    BEFORE: List of IP addresses in use in the 192.168.1.0/24 subnet

    AFTER: List of IP addresses NOT in use in that subnet.
    Attached Files Attached Files

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Invert list of IP addresses

    Are you fine with VBA?

  5. #5
    Registered User
    Join Date
    04-18-2016
    Location
    Belgium
    MS-Off Ver
    2013
    Posts
    4

    Re: Invert list of IP addresses

    Yes, I can do some VBA.

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Invert list of IP addresses

    b2=RIGHT(A2,LEN(A2)-10)*1

    c2=IF(ISNA(VLookup(Row();$b$2:$b$15000;1;0)="true"),"192.168.1."&Row(),"")

    see the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  7. #7
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Invert list of IP addresses

    Please Login or Register  to view this content.
    See the file attached.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-18-2016
    Location
    Belgium
    MS-Off Ver
    2013
    Posts
    4

    Re: Invert list of IP addresses

    Thank you both for your reply. I have been fiddling around but don't quite get the result.

    The worklist is actually more like the one in this attachment. There are 18 different subnets of 256 IP addresses each.


    Oeldere, in your case the last missing addresses are not shown. e.g. 192.168.1.158
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Invert list of IP addresses

    Oeldere, in your case the last missing addresses are not shown. e.g. 192.168.1.158

    expand the formula in column C till row 254 (since this is the last value in column A.

    see the attached file.
    Last edited by oeldere; 04-18-2016 at 09:19 AM. Reason: red text added

  10. #10
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: Invert list of IP addresses

    Try this formula in B2:

    =IFERROR("192,168.1,"&SMALL(IF(COUNTIF($A$2:$A$157,"192.168.1."&ROW($1:$254))=0,ROW($1:$254),""),ROW(A1)),"")

    Enter with Ctrl+Shift+Enter

  11. #11
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Invert list of IP addresses

    Quote Originally Posted by tizzen33 View Post
    Thank you both for your reply. I have been fiddling around but don't quite get the result.
    What is incorrect with my solution? It returns exactly the same result as expected.

    Did you run the code by clicking on the run button?

+ 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. Replies: 3
    Last Post: 11-29-2014, 07:30 AM
  2. Correct list of e-mail addresses
    By Vidhur100 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-29-2014, 03:51 AM
  3. how to invert a list of data with macro?
    By rukia in forum Excel General
    Replies: 5
    Last Post: 10-20-2009, 08:00 AM
  4. Look up a list of email addresses?
    By akopp in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2008, 05:54 PM
  5. [SOLVED] Converting list of IP Addresses to list of Hostname
    By M. Eteum in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2006, 02:20 PM
  6. Converting list of IP Addresses to list of Hostname
    By M. Eteum in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-23-2006, 02:20 PM
  7. How do I create a list of names and addresses?
    By CJ in forum Excel General
    Replies: 1
    Last Post: 03-13-2006, 12:25 AM

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