=A1-TEXT(A1,"[>20]3;[>5]2;1")
=IF(A1>20,A1-3,IF(AND(A1>5,A1<20),A1-2,IF(A1<5,A1-1,A1))),另外,如果A1=20或5怎么处理你没有说清楚哦,你再补充一下我帮你改
假设这个单元格A1,则:
=A1-IF(A1>20,3,IF(A1<5,1,2))
=IF(M7<5,M7-1,IF(M7<20,M7-2,M7-3))
=A1-LOOKUP(A1,{0,5,20},{1,2,3})