在需要结果的地方输入:
=LOOKUP(FIND(A1,"(10,11,18,19,26,27,40,41,48,49)(01,08,09,22,23,30,31,38,39)(06,07,14,15,28,29,36,37,44,45)(02,03,16,17,24,25,32,33,46,47)(04,05,12,13,20,21,34,35,42,43)"),{0,31,59,90,121},{0,1,2,3,4})
特别提醒,请在A1输入数据前将其设置为 “文本” ,否则输入01-09时候 结果会错误!
b1=IF(ISNA(MATCH(A1,{10,11,18,19,26,27,40,41,48,49},0)),IF(ISNA(MATCH(A1,{1,8,9,22,23,30,31,38,39},0)),IF(ISNA(MATCH(A1,{6,7,14,15,28,29,36,37,44,45},0)),IF(ISNA(MATCH(A1,{2,3,16,17,24,25,32,33,46,47},0)),IF(ISNA(MATCH(A1,{4,5,12,13,20,21,34,35,42,43},0)),5,4),3),2),1),0)
复制公式即可
本来想看看有没有什么规律可以取巧,结果发现一点规律都没有
B1输入
=if(isnumber(find(a1,"10,11,18,19,26,27,40,41,48,49")),0,if(isnumber(find(a1,"01,08,09,22,23,30,31,38,39")),1,if(isnumber(find(a1,"06,07,14,15,28,29,36,37,44,45")),2,if(isnumber(find(a1,"02,03,16,17,24,25,32,33,46,47")),3,4))))
请注意,A1单元格请一定是2位数字,比如5应该是05才对
=IF(SUMPRODUCT(--(A1={10,11,18,19,26,27,40,41,48,49}))=1,0,IF(SUMPRODUCT(--(A1={1,8,9,22,23,30,31,38,39}))=1,1,IF(SUMPRODUCT(--(A1={6,7,14,15,28,29,36,37,44,45}))=1,2,IF(SUMPRODUCT(--(A1={2,3,16,17,24,25,32,33,46,47}))=1,3,IF(SUMPRODUCT(--(A1={4,5,12,13,20,21,34,35,42,43}))=1,4,"超出范围")))))
直接复制在B1单元格中就可以
如果考虑A1中01,02,03之类的可以直接把A1的格式改为自定义格式类型:00 就好了
一般我喜欢用vlookup
另外建一个表,第一列是你括号内的数据,第二列是你要的结果。
然后用vlookup可以很方便的找到。
需要修改的话,改原始表格就可以了