怎样用excel表格生成4位随机的编码,谢谢
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了怎样用excel表格生成4位随机的编码,谢谢相关的知识,希望对你有一定的参考价值。
如下图:在B列依次列出0-9,A-Z共36个字符,在A列分别赋予序号1-36,在D1输入公式=VLOOKUP(RANDBETWEEN(1,36),A2:B37,2,0)&VLOOKUP(RANDBETWEEN(1,36),A2:B37,2,0)&VLOOKUP(RANDBETWEEN(1,36),A2:B37,2,0)&VLOOKUP(RANDBETWEEN(1,36),A2:B37,2,0)。按F9刷新即可以出一个随机的4位编码。
公式看起来很长,实际也就是用&把4个VLOOKUP(RANDBETWEEN(1,36),A2:B37,2,0)连接起来。
参考技术A =CONCATENATE(IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),IF(INT(RAND()*2)=0,CHAR(INT(RAND()*25+65)),CHAR(INT(RAND()*25+97)))),IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),IF(INT(RAND()*2)=0,CHAR(INT(RAND()*25+65)),CHAR(INT(RAND()*25+97)))),IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),IF(INT(RAND()*2)=0,CHAR(INT(RAND()*25+65)),CHAR(INT(RAND()*25+97)))),IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),IF(INT(RAND()*2)=0,CHAR(INT(RAND()*25+65)),CHAR(INT(RAND()*25+97)))))在excel中怎样生成随机的4位字母数字组合,谢谢
产生大写字母与数字的组合=CHAR(RANDBETWEEN(65,90))
=IF(RAND()<0.5,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90))) &IF(RAND()<0.5,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RAND()<0.5,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RAND()<0.5,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90))) 参考技术A =if(randbetween(0,1),randbetween(0,9),char(randbetween(65,90)))&if(randbetween(0,1),randbetween(0,9),char(randbetween(65,90)))&if(randbetween(0,1),randbetween(0,9),char(randbetween(65,90)))&if(randbetween(0,1),randbetween(0,9),char(randbetween(65,90)))
以上是关于怎样用excel表格生成4位随机的编码,谢谢的主要内容,如果未能解决你的问题,请参考以下文章
怎样用Excel随机函数rand()生成随机数字和大写字母,能自动产生4位混合的