1、十进制转为ip地址公式
TEXT(INT(C2/16777216),“0”)&“.”&TEXT(INT((C2-INT(C2/16777216)*16777216)/65536),“0”)&“.”&TEXT(INT((C2-INT(C2/16777216)*16777216-INT((C2-INT(C2/16777216)*16777216)/65536)*65536)/256),“0”)&“.”&TEXT(MOD(C2,256),“0”)
A、B、C、D段转换方法如下,
2、ip地址公式转为十进制
=LEFT(A2,FIND(“.”,A2)-1)*2563+MID(A2,FIND(“.”,A2)+1,FIND(“.”,A2,FIND(“.”,A2)+1)-FIND(“.”,A2)-1)*2562+MID(A2,FIND(“.”,A2,FIND(“.”,A2)+1)+1,FIND(“.”,A2,FIND(“.”,A2,FIND(“.”,A2)+1)+1)-FIND(“.”,A2,FIND(“.”,A2)+1)-1)*256+RIGHT(A2,LEN(A2)-FIND(“.”,A2,FIND(“.”,A2,FIND(“.”,A2)+1)+1))