|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
各位老师好
我有个公式想插入表格的H2单元格,但是录制宏的时候发现公式太长,代码框写不下,我用&_连字符换行也不行,麻烦老师指导下如何分段写。公式如下:
公式如下:=INT((SUMIFS(生产领料序时簿!K:K,生产领料序时簿!M:M,IF(MONTH(TODAY())-1=0,YEAR(TODAY())-1&"-12",YEAR(TODAY())&"-"&MONTH(TODAY())-1),生产领料序时簿!H:H,B2)+SUMIFS(生产领料序时簿!K:K,生产领料序时簿!M:M,IF(MONTH(TODAY())-2=0,YEAR(TODAY())-1&"-12",IF(MONTH(TODAY())-2=-1,YEAR(TODAY())-1&"-11",YEAR(TODAY())&"-"&MONTH(TODAY())-2)),生产领料序时簿!H:H,B2)+SUMIFS(生产领料序时簿!K:K,生产领料序时簿!M:M,IF(MONTH(TODAY())-3=0,YEAR(TODAY())-1&"-12",IF(MONTH(TODAY())-3=-1,YEAR(TODAY())-1&"-11",IF(MONTH(TODAY())-3=-2,YEAR(TODAY())-1&"-10",YEAR(TODAY())&"-"&MONTH(TODAY())-3))),生产领料序时簿!H:H,B2)+SUMIFS(生产领料序时簿!K:K,生产领料序时簿!M:M,IF(MONTH(TODAY())-4=0,YEAR(TODAY())-1&"-12",IF(MONTH(TODAY())-4=-1,YEAR(TODAY())-1&"-11",IF(MONTH(TODAY())-4=-2,YEAR(TODAY())-1&"-10",IF(MONTH(TODAY())-4=-3,YEAR(TODAY())-1&"-9",YEAR(TODAY())&"-"&MONTH(TODAY())-4)))),生产领料序时簿!H:H,B2)+SUMIFS(生产领料序时簿!K:K,生产领料序时簿!M:M,IF(MONTH(TODAY())-5=0,YEAR(TODAY())-1&"-12",IF(MONTH(TODAY())-5=-1,YEAR(TODAY())-1&"-11",IF(MONTH(TODAY())-5=-2,YEAR(TODAY())-1&"-10",IF(MONTH(TODAY())-5=-3,YEAR(TODAY())-1&"-9",IF(MONTH(TODAY())-5=-4,YEAR(TODAY())-1&"-8",YEAR(TODAY())&"-"&MONTH(TODAY())-5))))),生产领料序时簿!H:H,B2)+SUMIFS(生产领料序时簿!K:K,生产领料序时簿!M:M,IF(MONTH(TODAY())-6=0,YEAR(TODAY())-1&"-12",IF(MONTH(TODAY())-6=-1,YEAR(TODAY())-1&"-11",IF(MONTH(TODAY())-6=-2,YEAR(TODAY())-1&"-10",IF(MONTH(TODAY())-6=-3,YEAR(TODAY())-1&"-9",IF(MONTH(TODAY())-6=-4,YEAR(TODAY())-1&"-8",IF(MONTH(TODAY())-6=-5,YEAR(TODAY())-1&"-7",YEAR(TODAY())&"-"&MONTH(TODAY())-6)))))),生产领料序时簿!H:H,B2))/6)
|
|