excel根据日期和条件生成编号

2024-12-03 20:38:02
推荐回答(3个)
回答1:

==LEFT($A$1,4)&TEXT(MID($A$1,FIND("年",$A$1)+1,FIND("月",$A$1)-FIND("年",$A$1)-1),"00")&$A2&VLOOKUP($G2,{"早餐",1;"午餐",2;"晚餐",3},2,0)&TEXT(ROW(A1),"00")

 这里年月日通过标题取值,不用手工输入。

回答2:

J3输入以下公式,然后向下填充公式
="201509"&TEXT(A3,"00")&VLOOKUP(G3,{"早餐",1;"午餐",2;"晚餐",3},2,0)&TEXT(ROW(A1),"00")

回答3:

=LEFT(A1,4)&TEXT(MID(A1,6,FIND("月",A1)-6),"00")&TEXT(A3,"00")&VLOOKUP(G3,{"早餐",1;"午餐",2;"晚餐",3},2,)&TEXT(ROW(A1),"00")