excel数字代码
发布网友
发布时间:2022-08-02 13:56
我来回答
共1个回答
热心网友
时间:2024-03-15 14:30
你这个取数逻辑可以简单描述如下:将0、1、2、3、4排列成一个圆圈的话,与自己距离为1的取值1,与自己的取值0,其他的取值2,所以可以设置公式如下:
=IF(ABS(LEFT(A2,1)-LEFT(A3,1))=0,"0",IF(ABS(LEFT(A2,1)-LEFT(A3,1))=1,"1",IF(ABS(LEFT(A2,1)-LEFT(A3,1))=4,"1","2"))) & IF(ABS(MID(A2,2,1)-MID(A3,2,1))=0,"0",IF(ABS(MID(A2,2,1)-MID(A3,2,1))=1,"1",IF(ABS(MID(A2,2,1)-MID(A3,2,1))=4,"1","2"))) & IF(ABS(RIGHT(A2,1)-RIGHT(A3,1))=0,"0",IF(ABS(RIGHT(A2,1)-RIGHT(A3,1))=1,"1",IF(ABS(RIGHT(A2,1)-RIGHT(A3,1))=4,"1","2")))
用到了ABS函数:取绝对值
if函数,条件判断
left 、mid、right 函数