在单元格 C1 中输入:
=RANDBETWEEN(1;5)
in cell D1 put:
=RANDBETWEEN(1;10)
在单元格 E1 中输入:
=IF(D1=1;RANDBETWEEN(2;10);IF(D1=10;RANDBETWEEN(1;9);CHOOSE(RANDBETWEEN(1;2);RANDBETWEEN(1;D1-1);RANDBETWEEN(D1+1;10))))
在单元格 F1 中输入:
=IF(MAX(D1:E1)-MIN(D1:E1)=1;IF(MIN(D1:E1)=1;RANDBETWEEN(3;10);IF(MIN(D1:E1)=9;RANDBETWEEN(1;8);CHOOSE(RANDBETWEEN(1;2);RANDBETWEEN(1;MIN(D1:E1)-1);RANDBETWEEN(MAX(D1:E1)+1;10))));IF(MAX(D1:E1)-MIN(D1:E1)=9;RANDBETWEEN(2;9);IF(MIN(D1:E1)=1;CHOOSE(RANDBETWEEN(1;2);RANDBETWEEN(2;MAX(D1:E1)-1);RANDBETWEEN(MAX(D1:E1)+1;10));IF(MAX(D1:E1)=10;CHOOSE(RANDBETWEEN(1;2);RANDBETWEEN(1;MIN(D1:E1)-1);RANDBETWEEN(MIN(D1:E1)+1;9));CHOOSE(RANDBETWEEN(1;3);RANDBETWEEN(1;MIN(D1:E1)-1);RANDBETWEEN(MIN(D1:E1)+1;MAX(D1:E1)-1);RANDBETWEEN(MAX(D1:E1)+1;10))))))
在单元格 G1 中输入:
=CONCATENATE(INDIRECT("A" & C1);" "; INDIRECT("B" & D1); " ";INDIRECT("B" & E1);" ";INDIRECT("B" & F1))
复制单元格 C1:G1 并隐藏列 C:F