Skip to main content

Sorting IP Addresses & Drag down IP Addresses formula in Excel

Sometimes you may need to assign IP address to your colleagues, and the range of IP address may generate from 192.168.1.1 to 192.168.10.1 for instance. What can you do to generate them easily? Actually, the normal Auto Fill feature cannot work with this, or you can just create them manually by entering them in cells one by one? In this article we will show you how to write formula to make Auto Fill (drag down formula) feature work for IP address.
Also IP address sorting is not possible with normal sort feature, In this article we will show you how to write formula to make sort feature work for IP address.
How to use formula more efficiently and save time when using Excel?
If you want to generate the range of IP Address from 192.168.1.1 to 192.168.10.1 (the increment number locates in the third octet), (any incrimental range) the following formula will help you.

1. Select a blank cell (says cell A1), enter first IP 192.168.1.1 then select another blank cell beside it  (say cell B1) enter below formula into the formula bar, and then press the Enter key. See screenshot: 
=VALUE(LEFT(A1,FIND(".",A1)-1))*2^24+VALUE(MID(A1,FIND(".",A1)+1,FIND(".",A1,FIND(".",A1)+1)-FIND(".",A1)-1))*2^16+VALUE(MID(A1,FIND(".",A1,FIND(".",A1)+1)+1,FIND(".",A1,FIND(".",A1,FIND(".",A1)+1)+1)-FIND(".",A1,FIND(".",A1)+1)-1))*2^8+VALUE(RIGHT(A1,LEN(A1)-FIND(".",A1,FIND(".",A1,FIND(".",A1)+1)+1)))






2. Then you can see the first IP Address is converted in IP Decimal.
3. Select a blank cell (says cell A2), enter last IP 192.168.10.1 of the range then drag down formula from cell B1 to B2.
4. Then will get IP Decimal value of last IP Address in range. 
5. Subtract first IP Decimal values from last IP Decimal to know the count of IPs in the Range. Enter Formula=B2-B1 into the formula bar, and then press the Enter key. See screenshot:
6. Now select a blank cell (says cell D1), enter first IP decimal 3232235777 then select another blank cell beside it  (say cell E1) enter below formula into the formula bar, and then press the Enter key. See screenshot: 
=ROUNDDOWN(D1/2^24,0)&"."&ROUNDDOWN(MOD(D1,2^24)/2^16,0)&"."&ROUNDDOWN(MOD(MOD(D1,2^24),2^16)/2^8,0)&"."&MOD(MOD(MOD(D1,2^24),2^16),2^8)






7. Next step is to drag down formula along with IP decimal. Simple way to do same for large range is select cell D2 & type 1 as cell value then type D2305 [IP decimal difference + 1] in name box which will navigate to cell D2305; with D2305 cell selected press Ctrl + Shift + Up Arrow key which will select cell range from D2 to D2305. Press Ctrl + D key to fill entire range with Cell value of D2 (that is value "1") See Screenshot:
8. Next step is select cell D2 & type next incremental IP Decimal as cell value 3232235778 & Select cell D1, D2 and double click on small square of selection box which will fill all incremental IP decimal till cell D2305. See Screenshot:
9. Similarly select Cell E1 & double click on small square of selection box which will fill all incremental IP Address till cell E2305. See Screenshot:

How to Sort IP address in Excel

You can use above technique of converting IP Address to IP decimal & sort IP decimal which will sort IP Address inturn.

    

Comments

TIC Academy said…
Wonderful blog for SAP which I have seen and it's absolutely great stuff on SAP Topics. Thanks for such a cool blog about SAP topics. Very good explanation on SAP concepts we do SAP Training in Chennai.
Regards,
SAP Training Institutes in Chennai | Best SAP Training in Chennai
Mithun said…
Excellent post with lots of information about Networking Technology.
CCNA Training in Chennai | Hardware and Networking Training in Chennai
itsbest10 said…
Top 5 Best Switch Brand In India
1. Legrand
2. GM Modular
3. Anchor
4. Havells
5. Simon
John Hardy said…
This one is very good for students who study in IP address. Thanks for sharing this article. Keep it up. Now it's time to avail 1 litre water bottle for more information.

Popular posts from this blog

INSTALL CISCO VPN CLIENT ON WINDOWS 10 (32 & 64 BIT). FIX REASON 442

This article shows how correctly install Cisco VPN Client (32 & 64 bit) on Windows 10 (32 & 64 bit) using simple steps, overcome the ‘ This app can’t run on this PC ’ installation error , plus fix the Reason 442: Failed to enable Virtual Adapter error message . The article applies to New Windows 10 installations or Upgrades from earlier Windows versions and all versions before or after Windows 10 build 1511 .  To simplify the article, we’ve broken it into the following two sections: How to Install Cisco VPN client on Windows 10 (clean installation or upgrade from previous Windows), including Windows 10 build prior or after build 1511 . How to Fix Reason 442: Failed to enable Virtual Adapter on Windows 10 Figure 1. The Cisco VPN Client Reason 442: Failed to enable Virtual Adapter error on Windows 10 HOW TO INSTALL CISCO VPN CLIENT ON WINDOWS 10 (NEW INSTALLATIONS OR O/S UPGRADES) The instructions below are for new or clean Windows 10 inst...

Linux File and Directory Permissions

file & directory protection is a essential of any OS and Linux OS is no exception for it! These authorizations allow you to choose exactly who can access your files & directory, providing an overall improved system security. There was one of the major flaws in the older Windows operating-system where, by standard, all users can see each other people's information (Windows 95, 98, Me). For overcoming it, editions of the Windows based computer system such as NT, 2000, XP and 2003 lot more security features added. They fully support file & directory permissions, just as Linux system has since the beginning. Together, we'll now assess a directory listing from our Lab Linux system hosting server, to help us understand the information provided. a simple 'ls' command will give you the file and directory listing within a given directory, including the option  '-l' will display number of new areas that we are going to discuss here:

How to create a Hirens Boot CD 15.2 USB Disk

Hiren’s BootCD (HBCD) is a bootable CD that contains a set of tools that can help users to fix their computer if their system fails to boot. More specifically, HBCD contains hardware diagnostic programs, partition tools, data recovery utilities, antivirus tools and many other tools to fix your computer problems.  I write this article because I use Hiren’s BootCD frequently to troubleshoot computer problems, specially when a computer doesn’t boot anymore due to a virus attack or due to a corrupted file system. In this article you will find instructions on how to put Hiren’s BootCD on a USB flash drive (stick) in order to troubleshoot computer problems in the future.