Link to home
Start Free TrialLog in
Avatar of TechnologyMangu
TechnologyMangu

asked on

Converting IP Range to CIDR in Excel

I have a spreadsheet (downloaded from a different site) that allows you to convert CIDR notation to ranges, masks, and other details, and I am trying to figure out if I can use a function to convert a range to CIDR. I don't have the knowledge to convert some of the scripts/functions to help.

What I'd like is a function that takes 2 cells and provides CIDR notation in a 3rd.

I've attached examples.
IP-Calculator.xlsm
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

In C7 you can simply apply this formula...

=B7&"/"&RIGHT(B8,2)

Open in new window


In additional another safe way to do this since IP address at the end can be 3 characters as well you can do this as well to ensure it picks up correctly irrespective if its 3 characters or 2 characters...

=B7&"/"&SUBSTITUTE(RIGHT(B8,3),".","")

Open in new window


Assuming the last ip address will be of 2 digits...

Saurabh...
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.