- 精华
- 0
- 帖子
- 208
- 威望
- 0 点
- 积分
- 209 点
- 种子
- 57 点
- 注册时间
- 2019-9-15
- 最后登录
- 2024-6-12
|
楼主 |
发表于 2023-7-6 22:58 · 广东
|
显示全部楼层
本帖最后由 HoZt 于 2023-7-6 23:12 编辑
谢谢,可以了,自己再把单元格里的公式一个个套起来,最后做到三条公式分别解析出IP、掩码、网关。
IP单元格内容
=CONCATENATE("IP:",LEFT(Database!B11,FIND("/",Database!B11)-1))
掩码单元格内容
=CONCATENATE("掩码:",BIN2DEC(LEFT(REPT("1",RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11)))&REPT("0",32-RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11))),8))&"."&BIN2DEC(MID(REPT("1",RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11)))&REPT("0",32-RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11))),9,8))&"."&BIN2DEC(MID(REPT("1",RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11)))&REPT("0",32-RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11))),17,8))&"."&BIN2DEC(MID(REPT("1",RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11)))&REPT("0",32-RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11))),25,8)))
网关单元格内容
=CONCATENATE("网关:",BITAND(BIN2DEC(LEFT(REPT("1",RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11)))&REPT("0",32-RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11))),8)),LEFT(LEFT(Database!B11,FIND("/",Database!B11)-1),FIND("~",SUBSTITUTE(LEFT(Database!B11,FIND("/",Database!B11)-1),".","~",1))-1))&"."&BITAND(BIN2DEC(MID(REPT("1",RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11)))&REPT("0",32-RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11))),9,8)),MID(LEFT(Database!B11,FIND("/",Database!B11)-1),FIND("~",SUBSTITUTE(LEFT(Database!B11,FIND("/",Database!B11)-1),".","~",1))+1,FIND("~",SUBSTITUTE(LEFT(Database!B11,FIND("/",Database!B11)-1),".","~",2))-FIND("~",SUBSTITUTE(LEFT(Database!B11,FIND("/",Database!B11)-1),".","~",1))-1))&"."&BITAND(BIN2DEC(MID(REPT("1",RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11)))&REPT("0",32-RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11))),17,8)),MID(LEFT(Database!B11,FIND("/",Database!B11)-1),FIND("~",SUBSTITUTE(LEFT(Database!B11,FIND("/",Database!B11)-1),".","~",2))+1,FIND("~",SUBSTITUTE(LEFT(Database!B11,FIND("/",Database!B11)-1),".","~",3))-FIND("~",SUBSTITUTE(LEFT(Database!B11,FIND("/",Database!B11)-1),".","~",2))-1))&"."&BITAND(BIN2DEC(MID(REPT("1",RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11)))&REPT("0",32-RIGHT(Database!B11,LEN(Database!B11)-FIND("/",Database!B11))),25,8)),MID(LEFT(Database!B11,FIND("/",Database!B11)-1),FIND("~",SUBSTITUTE(LEFT(Database!B11,FIND("/",Database!B11)-1),".","~",3))+1,LEN(LEFT(Database!B11,FIND("/",Database!B11)-1))-FIND("~",SUBSTITUTE(LEFT(Database!B11,FIND("/",Database!B11)-1),".","~",3))))+1)
其中Database!B11,表示工作表Database里B11这个单元格,其内容是10.32.5.66/29这类字符串。 |
|