=CHOOSE(RANDBETWEEN(1,3),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)),CHAR(RANDBETWEEN(97,122)))&……&CHOOSE(RANDBETWEEN(1,3),CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)),CHAR(RANDBETWEEN(97,122)))
注释:1、RANDBETWEEN(1,3)表示在1、2、3中随机选择一个数;
2、CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)),CHAR(RANDBETWEEN(97,122))分别表示随机产生1~9,A~Z,a~z中的一个符号;
3、CHOOSE函数表示随机选择1~9,A~Z,a~z中的一个符号作为密码的某一位,该函数一共使用12次,在把12个符号连起来成一个12位密码。
注意:如果嫌函数太长,可以分步进行,例如:
A1=CHAR(RANDBETWEEN(48,57))
B1=CHAR(RANDBETWEEN(65,90))
C1=CHAR(RANDBETWEEN(97,122))
D1=CHOOSE(RANDBETWEEN(1,3),A1,A2,A3)
把A1到D1全选,向下拉成12行
E1=D1&D2&D3&D4&D5&D6&D7&D8&D9&D10&D11&D12
12位的密码存储在E1中
按F9刷新一次,生成一个新的12位密码
EXCEL2007函数公式,F9刷新结果
=IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))&IF(RANDBETWEEN(1,2)=1,CHAR(RANDBETWEEN(48,57)),CHAR(RANDBETWEEN(65,90)))
=INDEX({1;2;3;4.......;x;y;z},(INT(RAND()*36)+1))&.....&INDEX({1;2;3;4.......;x;y;z},(INT(RAND()*36)+1))
大括号里面补齐,分号分隔,&号连接12
完成后F9刷新下就随机产生一个