在EXCEL中将汉字转换为GB2312编码
我想在excel中的第一个单元格里输入汉字后面一个单元格就是第一个单元格里文字的GB2312编码,,怎么才能实现呀?我要转换成转换为GB2312编码比如:“重庆”转换成G...
我想在excel中的第一个单元格里输入汉字后面一个单元格就是第一个单元格里文字的GB2312编码,,怎么才能实现呀?
我要转换成转换为GB2312编码 比如:“重庆”转换成GB2312就是“%D6D8%C7EC” 展开
我要转换成转换为GB2312编码 比如:“重庆”转换成GB2312就是“%D6D8%C7EC” 展开
2个回答
推荐于2017-09-13
展开全部
数据输入在a1
在b1输入
=code(a1)
转换了啊,你的是16进制的,我给你的公式得到的是10进制的
你要是非要16进制
那么这样
需要 点工具-加载宏-分析工具库(VBA函数)
然后数据输入在a1
在b1输入
="%"&DEC2HEX(CODE(A1))
一定要先加在分析工具,否则出错
另外一次只能转换1个汉字
输入多个也只转换第一个字
如果不想加载数据分析工具
可以这样
数据输入在a1,比如 重
b1输入
="%"&LOOKUP(INT(CODE(A1) /4096),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"})&LOOKUP(INT(MOD(CODE(A1),4096)/256),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"})&LOOKUP(INT(MOD(MOD(CODE(A1),4096),256)/16),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"})&LOOKUP(MOD(MOD(MOD(CODE(A1),4096),256),16),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"})
结果是 %D6D8
其实就是10进制转换为16进制了
在b1输入
=code(a1)
转换了啊,你的是16进制的,我给你的公式得到的是10进制的
你要是非要16进制
那么这样
需要 点工具-加载宏-分析工具库(VBA函数)
然后数据输入在a1
在b1输入
="%"&DEC2HEX(CODE(A1))
一定要先加在分析工具,否则出错
另外一次只能转换1个汉字
输入多个也只转换第一个字
如果不想加载数据分析工具
可以这样
数据输入在a1,比如 重
b1输入
="%"&LOOKUP(INT(CODE(A1) /4096),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"})&LOOKUP(INT(MOD(CODE(A1),4096)/256),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"})&LOOKUP(INT(MOD(MOD(CODE(A1),4096),256)/16),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"})&LOOKUP(MOD(MOD(MOD(CODE(A1),4096),256),16),{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15;0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"})
结果是 %D6D8
其实就是10进制转换为16进制了
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询