求大神指点!!!
如下:有两个函数:1、=IF(B2="主业","HTZY2021"&TEXT(COUNTIF($B$2:B2,"主业"),"000"),IF(B2="辅业","HTFY2021"&TEXT(COUNTIF($B$2:B2,"辅业"),"000"),""))
当B2为主业时,结果为:HTZY2021001
2、想加上日期:=IF(B2="主业","HTZY"&TEXT(TODAY(),("yyyymmdd"&TEXT(COUNTIF($B$2:B2,"主业"),"000"))),IF(B2="辅业","HTFY"&TEXT(TODAY(),("yyyymmdd"&TEXT(COUNTIF($B$2:B2,"辅业"),"000"))),""))
当B2为主业时,结果为:HTZY202109251
想把第二个公式结果调整为:HTZY20210925001
求指点!!!
=IF(B3="主业","HTZY",IF(B3="辅业","HTFY"))&TEXT(TODAY(),"emmdd")&TEXT(COUNTIF(B$2:B3,B3),"000") 成了,完全正确!非常感谢!!! 好像又有点问题,B列不是主业或辅业时想显示空值!还有就是,能不能再加主业、辅业外的其它条件! =IF(B2="","","HTZY"&TEXT(TODAY(),"emmdd")*1000+COUNTIF($B$2:B2,B2)) B列不是主业或辅业时想显示空值!还有就是,能不能再加主业、辅业外的其它条件! 圈内大神就是多,学习了学习了 模拟结果,发附件。 B列不是主业或辅业时想显示空值:
=IF(OR(B2={"主业","辅业"}),"HTZY"&TEXT(TODAY(),"emmdd")*1000+COUNTIF($B$2:B2,B2),"")
加条件,请模拟结果,发附件。 您好大佬,"HTZY"是要根据B列变化的,主业是HTZY,辅业是HTFY。