What range does an ip fall in formula help

mwood6275

New Member
Joined
Apr 27, 2016
Messages
38
ok so here is what I am trying to figure out.

Let's say I have an ip of 192.168.1.1 and I need 13 ips for that range. Thus it becomes 192.168.1.1/28.

so what I need is a formula that where I can put the number of ips needed into a cell, the first ip that I plan to use in the next cell and then it checks the range in returns the / value. below is a named range called range2 which is where the result should come from.

Host Chart
/Mask Hosts
1 2,147,483,648
2 1,073,741,824
3 536,870,912
4 268,435,456
5 134,217,728
6 67,108,864
7 33,554,432
8 16,777,216
9 8,388,608
10 4,194,304
11 2,097,152
12 1,048,576
13 524,288
14 262,144
15 131,072
16 65,536
17 32,768
18 16,384
19 8,192
20 4,096
21 2,048
22 1,024
23 512
24 256
25 128
26 64
27 32
28 16
29 8
30 4
31 2
32 2
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Since those are all powers of 2, you can create a formula without using your range2:

ABC
192.168.1.1192.168.1.1/28

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: right"]13[/TD]

</tbody>
Sheet7

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]C1[/TH]
[TD="align: left"]=A1&"/"&32-ROUNDUP(LOG(B1,2),0)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
guess I spoke just a little too soon .. hehe

I only want it to return the /value because the ip address will already be there.
 
Upvote 0
Easy enough:

="/"&32-ROUNDUP(LOG(B1,2),0)

and if you just want the value without the /

=32-ROUNDUP(LOG(B1,2),0)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top