ecxel技巧函数:判断一个数,是前后两位相同,是前两位相同,后两位相同等

=IF(AND((MID(D2,1,1)=MID(D2,2,1)),(MID(D2,1,1)=RIGHT(D2,1)),(MID(D2,1,1)=MID(D2,LEN(D2)-1,1))),"前后两同",IF(AND((MID(D2,1,1)=MID(D2,2,1)),(MID(D2,1,1)=MID(D2,3,1)),(MID(D2,1,1)=MID(D2,4,1))),"前四相同",IF(AND((RIGHT(D2,1)=MID(D2,LEN(D2)-1,1)),MID(D2,LEN(D2)-1,1)=MID(D2,LEN(D2)-2,1),RIGHT(D2,1)=MID(D2,LEN(D2)-3,1)),"后四同",IF(AND(MID(D2,1,1)=MID(D2,2,1),MID(D2,1,1)=MID(D2,3,1),MID(D2,1,1)=MID(D2,4,1),MID(D2,1,1)=RIGHT(D2,1),MID(D2,1,1)=MID(D2,LEN(D2)-1,1),MID(D2,1,1)=MID(D2,LEN(D2)-2,1),MID(D2,1,1)=MID(D2,LEN(D2)-3,1)),"都相同",IF(AND((RIGHT(D2,1)=MID(D2,LEN(D2)-1,1)),MID(D2,LEN(D2)-1,1)=MID(D2,LEN(D2)-2,1)),"后三同",IF(AND(MID(D2,1,1)=MID(D2,2,1),MID(D2,1,1)=MID(D2,3,1),MID(D2,2,1)=MID(D2,3,1)),"前三相同",IF(MID(D2,1,1)=MID(D2,2,1),"前两相同",IF(RIGHT(D2,1)=MID(D2,LEN(D2)-1,1),"右两相同","普通"))))))))


IF(AND((MID(D2,1,1)=MID(D2,2,1)),(MID(D2,1,1)=RIGHT(D2,1)),(MID(D2,1,1)=MID(D2,LEN(D2)-1,1))),"前后两同

IF(AND((MID(D2,1,1)=MID(D2,2,1)),(MID(D2,1,1)=MID(D2,3,1)),(MID(D2,1,1)=MID(D2,4,1))),"前四相同"

IF(AND((RIGHT(D2,1)=MID(D2,LEN(D2)-1,1)),MID(D2,LEN(D2)-1,1)=MID(D2,LEN(D2)-2,1),RIGHT(D2,1)=MID(D2,LEN(D2)-3,1)),"后四同"

IF(AND(MID(D2,1,1)=MID(D2,2,1),MID(D2,1,1)=MID(D2,3,1),MID(D2,1,1)=MID(D2,4,1),MID(D2,1,1)=RIGHT(D2,1),MID(D2,1,1)=MID(D2,LEN(D2)-1,1),MID(D2,1,1)=MID(D2,LEN(D2)-2,1),MID(D2,1,1)=MID(D2,LEN(D2)-3,1)),"都相同"

IF(AND((RIGHT(D2,1)=MID(D2,LEN(D2)-1,1)),MID(D2,LEN(D2)-1,1)=MID(D2,LEN(D2)-2,1)),"后三同"

IF(AND(MID(D2,1,1)=MID(D2,2,1),MID(D2,1,1)=MID(D2,3,1),MID(D2,2,1)=MID(D2,3,1)),"前三相同"

IF(MID(D2,1,1)=MID(D2,2,1),"前两相同"

IF(RIGHT(D2,1)=MID(D2,LEN(D2)-1,1),"右两相同"

分享到:更多

相关推荐

!!!本站所有软件安装及教程方案都可以远程付费解决 客服QQ: 2716059214 (9:00-18:00在线) !!!


发表评论

路人甲 表情
Ctrl+Enter快速提交

网友评论(0)