=IF($AC$2=0,"",IF(O7="本月合计","本年累计",IF(OR(ROW()=$Q$3,ROW()=$R$3,ROW()=$S$3,ROW()=$T$3,ROW()=$U$3,ROW()=$V$3,ROW()=$W$3,ROW()=$X$3,ROW()=$Y$3,ROW()=$Z$3,ROW()=$AA$3,ROW()=$AB$3),"本月合计",IF(ROW()<9,$N$8,OFFSET($N$8,COUNT($O7:O$8),0)))))
遇到函数嵌套就得从外向内像剥洋葱一样,一层层剥掉就清楚了。
第一层:IF($AC$2=0,"",x) 这个楼主应该懂
第二层:IF(O7="本月合计","本年累计",x) 这个也得懂
第三层:IF(OR(ROW()=$Q$3,ROW()=$R$3,ROW()=$S$3,ROW()=$T$3,ROW()=$U$3,ROW()=$V$3,ROW()=$W$3,ROW()=$X$3,ROW()=$Y$3,ROW()=$Z$3,ROW()=$AA$3,ROW()=$AB$3),"本月合计",x)这一层里面or就是里面的条件只要满足一个就成立
第四层:IF(ROW()<9,$N$8,x)
OFFSET($N$8,COUNT($O7:O$8),0) 行偏移COUNT($O7:O$8), 列不偏移 |