SlideShare una empresa de Scribd logo
1 de 33
IP Functions
Introduction


ipfx@rajivbhardwaj.com
Version Details



       Version         Date     Edited by      Section/s                            Comments
    1.0          22-02-2012   Rajiv Bhardwaj      All      First Draft
    1.1          19-06-2012   Rajiv Bhardwaj      All      Added four more functions, Removed “RB_” prefix from function
                                                           names
Purpose:
Provide Introduction to Excel based IP functions created by me.
Provide Instructions for Installation and operating the IP Functions .



Scope:
Provide Excel based IP functions for easier IP Planning.
Provide Excel based IP functions for creating automated templates.
Motivation


After I got tired with manually modifying IP address in excel, I decided to give a try
to creating some kind of formulae.
I got some success with inbuilt “left” & “right” functions. e.g. by using something
like this to increment the IP address at position A1.
LEFT(A1,FIND(“.”,A1,FIND(“.”,A1,FIND(“.”,A1,1)+1)+1))&RIGHT(A1,LEN(A1)-FIND_
(“.”,A1,FIND(“.”,A1,FIND(“.”,A1,1)+1)+1))+1
Limitation of using Formulae

But soon it became quite cumbersome because of 3 reasons.
1. Every time I wanted to use this formula I had to change the reference cell ID “A1″
manually. It defeated the original purpose of automation.
2. It didn’t work well for changing the Class A or B IP Subnets i.e. updating any of
the first three “parts” of IP address.
3. As I started working on some IP hungry nodes. Handling of huge number of IPs
became almost impossible by this method.
To overcome these limitations I tried to create VBA based functions which are
easier to use and provide more functionalities.
I didn’t have much experience with macros and VBA, but still was able to create a
set of working functions.
IP Functions

I have complied all the IP address related functions in Add-in format. This way it is
easy to share all the functions without much effort on the end user part.
Although, .xla format is not fully portable as excel sheets created by one user
cannot be used by another user without updating the links. But it’s the easiest way
to transfer reusable functions.
This Add-in RBIPFx include following functions in present version (0.3).

1. IP_Bits2Mask
2. IP_ErrChk
3. IP_Hosts
4. IP_IP2Mbits
5. IP_Mod
6. IP_NextSub
IP Functions

7. IP_Bcast
8. IP_Count
9. IP_IsExist
10. IP_Mask2Bits
11. IP_Subnet
INSTALLING EXCEL ADD-IN
Installing RBIPFx Addin -I

1. First move the add-in file (“.xla”) to “C:Addins” folder
2. For Excel 2003 or older, go to addins menu by selecting Tools->Add-ins.
3. Then choose the desired add-in from list. Add-in will appear in the list if you
have copied it to the right Add-in folder as described in step 1.
4. If Add-in is not displayed in the list then you can use the browse button to locate
the Add-in File.
Installing RBIPFx Addin -II

For Office 2007 or later:
1. First move the add-in file (“.xla”) to “C:Addins” folder
2. Click on the Office button in top left corner.
3. Then choose excel options.
Installing RBIPFx Addin -III

4. Select “Add-ins” , choose Manage “Excel Add-ins” and click Go.




5. Then choose the RBIPFx.xla add-in from list and click OK. Add-in will appear in
the list if you have copied it to the right Add-in folder as described in step 1.
Installing RBIPFx Addin -IV

6. If Add-in is not displayed in the list then you can use the browse button to locate
the Add-in File.
7. If Add-in is correctly installed then it may show a relevant message.




8. Once installation is complete then you can see the “compatible” add-ins in the
Add-ins tab of office ribbon. (Optional)
FUNCTION DESCRIPTION
IP_Mod: IP Modification Function

IP_Mod: This is the primary function of RBIPFx Excel Add-in. It modifies the IP
addresses.
Syntax: RB_Mod_IP( IP address, optional Step, Optional Part)
Parameters:
IP Address: As the name suggest is IPV4 IP address which you want to modify.
Step: It is the number by which you want to increment or decrement the given IP
address. It is optional and default value of this parameter is 1.
Part: It is the part of IP address you want to modify. As IPv4 address as 4 parts
separated by “.”.
i.e For IP 10.11.12.13, Part 1 =10, part 2=11, Part3 =12 & Part4 =13.
It is also optional parameter & default value of this part is 4. i.e. last part (Class C
subnet)
IP_Mod: IP Modification Function - Usage

USAGE: Following are some of the ways, this function can be used.
i) You can increment the IP by one just by using the IP address parameter. i.e.
IP_Mod(“10.11.12.13″,1) will give 10.11.12.14.
IP_Mod: IP Modification Function - Usage


As I have set the value of Step to be 1 by default so IP_Mod(“10.11.12.13″) will also
do.
IP_Mod: IP Modification Function - Usage

Dragging this function in excel column will give you a series of IPs.
IP_Mod: IP Modification Function - Usage

But if you want to increment the IP with bigger value then you need to use the
parameter STEP.
e.g
IP_Mod(“10.11.12.13″, 10) will give you 10.11.12.23.
IP_Mod: IP Modification Function - CIDR

IP address with subnet maskbits (e.g. xx.xx.xx.xx/24) is also used in the IP domain
This function can handle that too. It automatically detects the subnet mask
separator (“/”) and uses the same format for output.
e.g
IP_Mod(“10.11.12.13/24″,10,3) will give you 10.11.22.13/24 as output.
IP_Mod: IP Modification Function - Decrement

If you want to decrement an IP address instead of incrementing then you can do
that too by just giving a negative Step Value.
e.g IP_Mod(10.11.12.13, -5) will give 10.11.12.8
IP_Mod: IP Modification Function - Error Handling

Error Handling: It can handle basic error situations.
if you input a step value more than 255 or less than -255. Function will return an
error.
e.g.
IP_Mod(10.11.12.13, 258) will give “#NUM” as return. This error is inline with basic
excel errors as it signifies that wrong value of number is being used.
IP_Mod: IP Modification Function - Error Handling

I initially had pop-up message for such situations but it becomes quite irritating if
we have a large sheet full of IP addresses.
One more situation which I have captured is that sometimes input is well within
range but the resultant IP is out of range. It also generates error in such situation.
e.g. IP_Mod(10.11.12.13, 245) will give “#NUM” error as resultant IP 10.11.12.258
is not the valid one. For me this error functionality is a real life saver as I tend to
forget this “255″ limit.
IP_NextSub: Next Subnet Function

This function calculates next IP subnet. Subnet mask is mandatory parameter for
this function.




This function can also work with CIDR notation.




If both CIDR notation and Maskbit parameter are given, maskbit parameter is given
higher priority.
IP_Bits2Mask

Converts Bits to Subnet Mask
IP_ErrChk

Function checks if IP Address is valid or not
IP_Hosts

Function calculates number of hosts from mask bits.
It automatically deducts 2 IPs from the number of hosts to compensate for network
address & broadcast address
IP_IP2Mbits

This function calculates the Mask Bits (Subnet Mask) for the required number of
IPs.
e.g. If we require 11 IPs then a IP subnet with subnet mask of /28 is required.
IP_Subnet

This function calculates the Subnet (Network Address) for the given IP
e.g. Subnet for 10.1.1.99/28 is calculated to be 10.1.1.96.
IP_Bcast

This function calculates the Broadcast address for given IP .
e.g. Broadcast address for 10.1.1.99/28 is 10.1.1.111
IP_Mask2Bits

This function calculates the Mask Bits from the Subnet mask in “x.x.x.x” format.
e.g. Subnet mask 255.255.255.240 is equivalent to 28 maskbits i.e. /28.
IP_IsExist

This is a boolean function to check if one IP exists in an IP range (Subnet). It also
checks if an IP subnet overlaps with other IP subnet.
First argument is the IP range, in which the given IP (subnet) will be checked
Second argument is the IP (Subnet) to be checked
e.g. We can check if 10.1.1.112 exists with in 10.1.1.96/28.
IP_Count

This function counts the occurrence of an IP address in a given range of IP network
addresses (subnets). It can be used to check the overlapping subnets in an IP Plan
First argument is the IP range, in which the given IP (subnet) will be checked
Second argument is the IP (Subnet) to be checked
Thank You

Más contenido relacionado

La actualidad más candente

toaz.info-troubleshooting-lte-ran-nokia-pr_5a9f9e698001cd6b88c6d8628b5e7dc6.pdf
toaz.info-troubleshooting-lte-ran-nokia-pr_5a9f9e698001cd6b88c6d8628b5e7dc6.pdftoaz.info-troubleshooting-lte-ran-nokia-pr_5a9f9e698001cd6b88c6d8628b5e7dc6.pdf
toaz.info-troubleshooting-lte-ran-nokia-pr_5a9f9e698001cd6b88c6d8628b5e7dc6.pdf
sehat maruli
 
Introduction to VoIP using SIP
Introduction to VoIP using SIPIntroduction to VoIP using SIP
Introduction to VoIP using SIP
Kundan Singh
 
LTE Reviews - PCI Analysis
LTE Reviews - PCI AnalysisLTE Reviews - PCI Analysis
LTE Reviews - PCI Analysis
paulo_campolina
 
MINI-LINK PT_Node GUI Descriptions.pdf
MINI-LINK PT_Node GUI Descriptions.pdfMINI-LINK PT_Node GUI Descriptions.pdf
MINI-LINK PT_Node GUI Descriptions.pdf
freedman701
 
RTCL_Passive Maintenance Operation Presentation
RTCL_Passive Maintenance Operation PresentationRTCL_Passive Maintenance Operation Presentation
RTCL_Passive Maintenance Operation Presentation
Engr. Yeashir Arafat
 
39018631 lte-overview
39018631 lte-overview39018631 lte-overview
39018631 lte-overview
cefer mecid
 

La actualidad más candente (20)

config_mini link
config_mini linkconfig_mini link
config_mini link
 
toaz.info-troubleshooting-lte-ran-nokia-pr_5a9f9e698001cd6b88c6d8628b5e7dc6.pdf
toaz.info-troubleshooting-lte-ran-nokia-pr_5a9f9e698001cd6b88c6d8628b5e7dc6.pdftoaz.info-troubleshooting-lte-ran-nokia-pr_5a9f9e698001cd6b88c6d8628b5e7dc6.pdf
toaz.info-troubleshooting-lte-ran-nokia-pr_5a9f9e698001cd6b88c6d8628b5e7dc6.pdf
 
Demystifying OpenStack for NFV
Demystifying OpenStack for NFVDemystifying OpenStack for NFV
Demystifying OpenStack for NFV
 
FTP Conflict troubleshooting & MINI-LINK TN FTP
FTP Conflict troubleshooting & MINI-LINK TN FTPFTP Conflict troubleshooting & MINI-LINK TN FTP
FTP Conflict troubleshooting & MINI-LINK TN FTP
 
Curso radio NEC Ipasolink 200.pdf
Curso radio NEC Ipasolink 200.pdfCurso radio NEC Ipasolink 200.pdf
Curso radio NEC Ipasolink 200.pdf
 
Introduction to VoIP using SIP
Introduction to VoIP using SIPIntroduction to VoIP using SIP
Introduction to VoIP using SIP
 
Huawei XPIC Hardware Connection
Huawei XPIC Hardware ConnectionHuawei XPIC Hardware Connection
Huawei XPIC Hardware Connection
 
Nmap
NmapNmap
Nmap
 
Wpa supplicant introduction
Wpa supplicant introductionWpa supplicant introduction
Wpa supplicant introduction
 
LTE Reviews - PCI Analysis
LTE Reviews - PCI AnalysisLTE Reviews - PCI Analysis
LTE Reviews - PCI Analysis
 
3 gpp lte-pdcp
3 gpp lte-pdcp3 gpp lte-pdcp
3 gpp lte-pdcp
 
Ericsson Radio System reaches new heights
Ericsson Radio System reaches new heightsEricsson Radio System reaches new heights
Ericsson Radio System reaches new heights
 
Configurar Elastik con el servicio de netelip
Configurar Elastik con el servicio de netelipConfigurar Elastik con el servicio de netelip
Configurar Elastik con el servicio de netelip
 
Le partage des fréquences radio: vers une gestion dynamique du spectre
Le partage des fréquences radio: vers une gestion dynamique du spectreLe partage des fréquences radio: vers une gestion dynamique du spectre
Le partage des fréquences radio: vers une gestion dynamique du spectre
 
MINI-LINK PT_Node GUI Descriptions.pdf
MINI-LINK PT_Node GUI Descriptions.pdfMINI-LINK PT_Node GUI Descriptions.pdf
MINI-LINK PT_Node GUI Descriptions.pdf
 
RTCL_Passive Maintenance Operation Presentation
RTCL_Passive Maintenance Operation PresentationRTCL_Passive Maintenance Operation Presentation
RTCL_Passive Maintenance Operation Presentation
 
Instalacion y configuracion de un servidor dhcp en linux
Instalacion y configuracion de un servidor dhcp en linuxInstalacion y configuracion de un servidor dhcp en linux
Instalacion y configuracion de un servidor dhcp en linux
 
39018631 lte-overview
39018631 lte-overview39018631 lte-overview
39018631 lte-overview
 
Muestreo
MuestreoMuestreo
Muestreo
 
baseband-6648.pdf
baseband-6648.pdfbaseband-6648.pdf
baseband-6648.pdf
 

Destacado

Uccn1003 -may10_-_lect03c_-_ip_subnets_rules
Uccn1003  -may10_-_lect03c_-_ip_subnets_rulesUccn1003  -may10_-_lect03c_-_ip_subnets_rules
Uccn1003 -may10_-_lect03c_-_ip_subnets_rules
Shu Shin
 
Operators in c language
Operators in c languageOperators in c language
Operators in c language
Amit Singh
 
The 8051 assembly language
The 8051 assembly languageThe 8051 assembly language
The 8051 assembly language
hemant meena
 
mySQL - INSERT INTO
mySQL - INSERT INTOmySQL - INSERT INTO
mySQL - INSERT INTO
lehrerfreund
 
Canvi climàtic: Efectes i percepció social
Canvi climàtic: Efectes i percepció socialCanvi climàtic: Efectes i percepció social
Canvi climàtic: Efectes i percepció social
Josep Lluís Ruiz
 
Tema 3 Dissolucions 1er batxillerat
Tema 3 Dissolucions 1er batxilleratTema 3 Dissolucions 1er batxillerat
Tema 3 Dissolucions 1er batxillerat
mmarti61
 
La Variació Lingüística
La Variació LingüísticaLa Variació Lingüística
La Variació Lingüística
Epsa Llengues
 

Destacado (20)

Uccn1003 -may10_-_lect03c_-_ip_subnets_rules
Uccn1003  -may10_-_lect03c_-_ip_subnets_rulesUccn1003  -may10_-_lect03c_-_ip_subnets_rules
Uccn1003 -may10_-_lect03c_-_ip_subnets_rules
 
Operators in c language
Operators in c languageOperators in c language
Operators in c language
 
Slides chapter 16
Slides chapter 16Slides chapter 16
Slides chapter 16
 
Elm intro
Elm introElm intro
Elm intro
 
Hr development, methods and desig
Hr development, methods and desigHr development, methods and desig
Hr development, methods and desig
 
The 8051 assembly language
The 8051 assembly languageThe 8051 assembly language
The 8051 assembly language
 
mySQL - INSERT INTO
mySQL - INSERT INTOmySQL - INSERT INTO
mySQL - INSERT INTO
 
Comment être agile dans un contexte non lié aux TI ?
Comment être agile dans un contexte non lié aux TI ?Comment être agile dans un contexte non lié aux TI ?
Comment être agile dans un contexte non lié aux TI ?
 
Convegno la mela nel mondo interpoma bz - 16-11-2012 1+2 - martin thalheime...
Convegno la mela nel mondo   interpoma bz - 16-11-2012 1+2 - martin thalheime...Convegno la mela nel mondo   interpoma bz - 16-11-2012 1+2 - martin thalheime...
Convegno la mela nel mondo interpoma bz - 16-11-2012 1+2 - martin thalheime...
 
Scrum Guide
Scrum GuideScrum Guide
Scrum Guide
 
area econòmica i patrimonial
area econòmica i patrimonialarea econòmica i patrimonial
area econòmica i patrimonial
 
Lliço5 Cinèticaquímica
Lliço5 CinèticaquímicaLliço5 Cinèticaquímica
Lliço5 Cinèticaquímica
 
Canvi climàtic: Efectes i percepció social
Canvi climàtic: Efectes i percepció socialCanvi climàtic: Efectes i percepció social
Canvi climàtic: Efectes i percepció social
 
Le Lean Product Management présenté au LeanKanban Day 2015
Le Lean Product Management présenté au LeanKanban Day 2015Le Lean Product Management présenté au LeanKanban Day 2015
Le Lean Product Management présenté au LeanKanban Day 2015
 
Arquitectura de Computadores (II Bimestre)
Arquitectura de Computadores (II Bimestre)Arquitectura de Computadores (II Bimestre)
Arquitectura de Computadores (II Bimestre)
 
Tema 3 Dissolucions 1er batxillerat
Tema 3 Dissolucions 1er batxilleratTema 3 Dissolucions 1er batxillerat
Tema 3 Dissolucions 1er batxillerat
 
Les propietats dels materials i els assaigs d'estudi
Les propietats dels materials i els assaigs d'estudiLes propietats dels materials i els assaigs d'estudi
Les propietats dels materials i els assaigs d'estudi
 
Tema15
Tema15Tema15
Tema15
 
1c-EL SEXENNI DEMOCRÀTIC
1c-EL SEXENNI DEMOCRÀTIC1c-EL SEXENNI DEMOCRÀTIC
1c-EL SEXENNI DEMOCRÀTIC
 
La Variació Lingüística
La Variació LingüísticaLa Variació Lingüística
La Variació Lingüística
 

Similar a Excel Based IP Functions

Uccn1003 -may10_-_lab_01_-_network_services_and_commands
Uccn1003  -may10_-_lab_01_-_network_services_and_commandsUccn1003  -may10_-_lab_01_-_network_services_and_commands
Uccn1003 -may10_-_lab_01_-_network_services_and_commands
Shu Shin
 
Uccn1003 -may10_-_lab_01_-_network_services_and_commands
Uccn1003  -may10_-_lab_01_-_network_services_and_commandsUccn1003  -may10_-_lab_01_-_network_services_and_commands
Uccn1003 -may10_-_lab_01_-_network_services_and_commands
Shu Shin
 
OOP-Module-1-Section-4-LectureNo1-5.pptx
OOP-Module-1-Section-4-LectureNo1-5.pptxOOP-Module-1-Section-4-LectureNo1-5.pptx
OOP-Module-1-Section-4-LectureNo1-5.pptx
sarthakgithub
 
C++ 2
C++ 2C++ 2
C++ 2
jani
 
SubNetwork Calculator (Python Project)
SubNetwork Calculator (Python Project)SubNetwork Calculator (Python Project)
SubNetwork Calculator (Python Project)
Dmitry Ponomarenko
 
Inline function
Inline functionInline function
Inline function
Tech_MX
 

Similar a Excel Based IP Functions (20)

Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal ShahzadFunction Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
 
Uccn1003 -may10_-_lab_01_-_network_services_and_commands
Uccn1003  -may10_-_lab_01_-_network_services_and_commandsUccn1003  -may10_-_lab_01_-_network_services_and_commands
Uccn1003 -may10_-_lab_01_-_network_services_and_commands
 
Uccn1003 -may10_-_lab_01_-_network_services_and_commands
Uccn1003  -may10_-_lab_01_-_network_services_and_commandsUccn1003  -may10_-_lab_01_-_network_services_and_commands
Uccn1003 -may10_-_lab_01_-_network_services_and_commands
 
Introduction to python programming 2
Introduction to python programming   2Introduction to python programming   2
Introduction to python programming 2
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
09 express, moooore
09 express, moooore09 express, moooore
09 express, moooore
 
O365 Saturday - Deepdive SharePoint Client Side Rendering
O365 Saturday - Deepdive SharePoint Client Side RenderingO365 Saturday - Deepdive SharePoint Client Side Rendering
O365 Saturday - Deepdive SharePoint Client Side Rendering
 
OOP-Module-1-Section-4-LectureNo1-5.pptx
OOP-Module-1-Section-4-LectureNo1-5.pptxOOP-Module-1-Section-4-LectureNo1-5.pptx
OOP-Module-1-Section-4-LectureNo1-5.pptx
 
C++ 2
C++ 2C++ 2
C++ 2
 
Chap 5 c++
Chap 5 c++Chap 5 c++
Chap 5 c++
 
inline function
inline function inline function
inline function
 
ACM init()- Day 4
ACM init()- Day 4ACM init()- Day 4
ACM init()- Day 4
 
SubNetwork Calculator (Python Project)
SubNetwork Calculator (Python Project)SubNetwork Calculator (Python Project)
SubNetwork Calculator (Python Project)
 
Handout # 3 functions c++
Handout # 3   functions c++Handout # 3   functions c++
Handout # 3 functions c++
 
Inline function
Inline functionInline function
Inline function
 
3 Ways to Get Started with a React App in 2024.pdf
3 Ways to Get Started with a React App in 2024.pdf3 Ways to Get Started with a React App in 2024.pdf
3 Ways to Get Started with a React App in 2024.pdf
 
Chap 5 c++
Chap 5 c++Chap 5 c++
Chap 5 c++
 
Compose Camp - Session1.pdf
Compose Camp - Session1.pdfCompose Camp - Session1.pdf
Compose Camp - Session1.pdf
 
Savitch Ch 04
Savitch Ch 04Savitch Ch 04
Savitch Ch 04
 
Savitch Ch 04
Savitch Ch 04Savitch Ch 04
Savitch Ch 04
 

Último

Último (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Excel Based IP Functions

  • 2. Version Details Version Date Edited by Section/s Comments 1.0 22-02-2012 Rajiv Bhardwaj All First Draft 1.1 19-06-2012 Rajiv Bhardwaj All Added four more functions, Removed “RB_” prefix from function names
  • 3. Purpose: Provide Introduction to Excel based IP functions created by me. Provide Instructions for Installation and operating the IP Functions . Scope: Provide Excel based IP functions for easier IP Planning. Provide Excel based IP functions for creating automated templates.
  • 4. Motivation After I got tired with manually modifying IP address in excel, I decided to give a try to creating some kind of formulae. I got some success with inbuilt “left” & “right” functions. e.g. by using something like this to increment the IP address at position A1. LEFT(A1,FIND(“.”,A1,FIND(“.”,A1,FIND(“.”,A1,1)+1)+1))&RIGHT(A1,LEN(A1)-FIND_ (“.”,A1,FIND(“.”,A1,FIND(“.”,A1,1)+1)+1))+1
  • 5. Limitation of using Formulae But soon it became quite cumbersome because of 3 reasons. 1. Every time I wanted to use this formula I had to change the reference cell ID “A1″ manually. It defeated the original purpose of automation. 2. It didn’t work well for changing the Class A or B IP Subnets i.e. updating any of the first three “parts” of IP address. 3. As I started working on some IP hungry nodes. Handling of huge number of IPs became almost impossible by this method. To overcome these limitations I tried to create VBA based functions which are easier to use and provide more functionalities. I didn’t have much experience with macros and VBA, but still was able to create a set of working functions.
  • 6. IP Functions I have complied all the IP address related functions in Add-in format. This way it is easy to share all the functions without much effort on the end user part. Although, .xla format is not fully portable as excel sheets created by one user cannot be used by another user without updating the links. But it’s the easiest way to transfer reusable functions. This Add-in RBIPFx include following functions in present version (0.3). 1. IP_Bits2Mask 2. IP_ErrChk 3. IP_Hosts 4. IP_IP2Mbits 5. IP_Mod 6. IP_NextSub
  • 7. IP Functions 7. IP_Bcast 8. IP_Count 9. IP_IsExist 10. IP_Mask2Bits 11. IP_Subnet
  • 9. Installing RBIPFx Addin -I 1. First move the add-in file (“.xla”) to “C:Addins” folder 2. For Excel 2003 or older, go to addins menu by selecting Tools->Add-ins. 3. Then choose the desired add-in from list. Add-in will appear in the list if you have copied it to the right Add-in folder as described in step 1. 4. If Add-in is not displayed in the list then you can use the browse button to locate the Add-in File.
  • 10. Installing RBIPFx Addin -II For Office 2007 or later: 1. First move the add-in file (“.xla”) to “C:Addins” folder 2. Click on the Office button in top left corner. 3. Then choose excel options.
  • 11. Installing RBIPFx Addin -III 4. Select “Add-ins” , choose Manage “Excel Add-ins” and click Go. 5. Then choose the RBIPFx.xla add-in from list and click OK. Add-in will appear in the list if you have copied it to the right Add-in folder as described in step 1.
  • 12. Installing RBIPFx Addin -IV 6. If Add-in is not displayed in the list then you can use the browse button to locate the Add-in File. 7. If Add-in is correctly installed then it may show a relevant message. 8. Once installation is complete then you can see the “compatible” add-ins in the Add-ins tab of office ribbon. (Optional)
  • 14. IP_Mod: IP Modification Function IP_Mod: This is the primary function of RBIPFx Excel Add-in. It modifies the IP addresses. Syntax: RB_Mod_IP( IP address, optional Step, Optional Part) Parameters: IP Address: As the name suggest is IPV4 IP address which you want to modify. Step: It is the number by which you want to increment or decrement the given IP address. It is optional and default value of this parameter is 1. Part: It is the part of IP address you want to modify. As IPv4 address as 4 parts separated by “.”. i.e For IP 10.11.12.13, Part 1 =10, part 2=11, Part3 =12 & Part4 =13. It is also optional parameter & default value of this part is 4. i.e. last part (Class C subnet)
  • 15. IP_Mod: IP Modification Function - Usage USAGE: Following are some of the ways, this function can be used. i) You can increment the IP by one just by using the IP address parameter. i.e. IP_Mod(“10.11.12.13″,1) will give 10.11.12.14.
  • 16. IP_Mod: IP Modification Function - Usage As I have set the value of Step to be 1 by default so IP_Mod(“10.11.12.13″) will also do.
  • 17. IP_Mod: IP Modification Function - Usage Dragging this function in excel column will give you a series of IPs.
  • 18. IP_Mod: IP Modification Function - Usage But if you want to increment the IP with bigger value then you need to use the parameter STEP. e.g IP_Mod(“10.11.12.13″, 10) will give you 10.11.12.23.
  • 19. IP_Mod: IP Modification Function - CIDR IP address with subnet maskbits (e.g. xx.xx.xx.xx/24) is also used in the IP domain This function can handle that too. It automatically detects the subnet mask separator (“/”) and uses the same format for output. e.g IP_Mod(“10.11.12.13/24″,10,3) will give you 10.11.22.13/24 as output.
  • 20. IP_Mod: IP Modification Function - Decrement If you want to decrement an IP address instead of incrementing then you can do that too by just giving a negative Step Value. e.g IP_Mod(10.11.12.13, -5) will give 10.11.12.8
  • 21. IP_Mod: IP Modification Function - Error Handling Error Handling: It can handle basic error situations. if you input a step value more than 255 or less than -255. Function will return an error. e.g. IP_Mod(10.11.12.13, 258) will give “#NUM” as return. This error is inline with basic excel errors as it signifies that wrong value of number is being used.
  • 22. IP_Mod: IP Modification Function - Error Handling I initially had pop-up message for such situations but it becomes quite irritating if we have a large sheet full of IP addresses. One more situation which I have captured is that sometimes input is well within range but the resultant IP is out of range. It also generates error in such situation. e.g. IP_Mod(10.11.12.13, 245) will give “#NUM” error as resultant IP 10.11.12.258 is not the valid one. For me this error functionality is a real life saver as I tend to forget this “255″ limit.
  • 23. IP_NextSub: Next Subnet Function This function calculates next IP subnet. Subnet mask is mandatory parameter for this function. This function can also work with CIDR notation. If both CIDR notation and Maskbit parameter are given, maskbit parameter is given higher priority.
  • 25. IP_ErrChk Function checks if IP Address is valid or not
  • 26. IP_Hosts Function calculates number of hosts from mask bits. It automatically deducts 2 IPs from the number of hosts to compensate for network address & broadcast address
  • 27. IP_IP2Mbits This function calculates the Mask Bits (Subnet Mask) for the required number of IPs. e.g. If we require 11 IPs then a IP subnet with subnet mask of /28 is required.
  • 28. IP_Subnet This function calculates the Subnet (Network Address) for the given IP e.g. Subnet for 10.1.1.99/28 is calculated to be 10.1.1.96.
  • 29. IP_Bcast This function calculates the Broadcast address for given IP . e.g. Broadcast address for 10.1.1.99/28 is 10.1.1.111
  • 30. IP_Mask2Bits This function calculates the Mask Bits from the Subnet mask in “x.x.x.x” format. e.g. Subnet mask 255.255.255.240 is equivalent to 28 maskbits i.e. /28.
  • 31. IP_IsExist This is a boolean function to check if one IP exists in an IP range (Subnet). It also checks if an IP subnet overlaps with other IP subnet. First argument is the IP range, in which the given IP (subnet) will be checked Second argument is the IP (Subnet) to be checked e.g. We can check if 10.1.1.112 exists with in 10.1.1.96/28.
  • 32. IP_Count This function counts the occurrence of an IP address in a given range of IP network addresses (subnets). It can be used to check the overlapping subnets in an IP Plan First argument is the IP range, in which the given IP (subnet) will be checked Second argument is the IP (Subnet) to be checked