Loading... <p> 一、单个字符的生成 </p> <p> <br /> </p> <pre class="prettyprint linenums">①随机小写字母:一位 =CHAR(INT(RAND()*25+97)) ②随机大写字母:一位 =CHAR(INT(RAND()*25+65)) ③随机数字:一位 =CHAR(INT(RAND()*9+48))</pre> 二、组合生成 <p> <br /> </p> <p> 随机生成10位字符串(数字,大写字母的方法) </p> <p> <pre class="prettyprint linenums">=CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))& CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))& CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))& CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))& CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))& CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))& CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))& CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))& CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))</pre> </p> <p> <pre class="prettyprint linenums">=CONCATENATE(IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),CHAR(INT(RAND()*25+65))), IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),CHAR(INT(RAND()*25+65))), IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),CHAR(INT(RAND()*25+65))), IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),CHAR(INT(RAND()*25+65))), IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),CHAR(INT(RAND()*25+65))), IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),CHAR(INT(RAND()*25+65))), IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),CHAR(INT(RAND()*25+65))), IF(INT(RAND()*2)=0,CHAR(INT(RAND()*9+48)),CHAR(INT(RAND()*25+65))))</pre> </p> 最后修改:2018 年 01 月 23 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏