一、单个字符的生成 ①随机小写字母:一位 =CHAR(INT(RAND()*25+97)) ②随机大写字母:一位 =CHAR(INT(RAND()*25+65)) ③随机数字:一位 =CHAR(INT(RAND()*9+48)) 二、组合生成 随机生成10位字符串(数字,大写字母的方法) =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))) =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)))) 最后修改:2018 年 01 月 23 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 如果觉得我的文章对你有用,请随意赞赏