本帖最后由 天边。。。 于 2018-3-8 08:19 编辑
以库存依次扣减需求数量,直到出现负数,并返回出现负数这一列的日期,具体如附件表格,请各位老师解答,感谢!
以下是目前使用的公式,运行效率非常低,希望能有更方便更简洁的方式
"=IF($I2-SUM(OFFSET($U2,,1,,(MATCH("(到货通知单数量)逾期数量",$V$1:$CI$1,0)-1)))>=0,"到"&MID(OFFSET($U$1,,(MATCH("(到货通知单数量)逾期数量",$V$1:$CI$1,0)-1)),13,6)&"不欠",IF($I2<SUM(OFFSET($U2,,1)),MID(OFFSET($U$1,,1),13,6),IF($I2<SUM(OFFSET($U2,,1,,2)),MID(OFFSET($U$1,,2),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,3)),MID(OFFSET($U$1,,3),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,4)),MID(OFFSET($U$1,,4),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,5)),MID(OFFSET($U$1,,5),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,6)),MID(OFFSET($U$1,,6),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,7)),MID(OFFSET($U$1,,7),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,8)),MID(OFFSET($U$1,,8),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,9)),MID(OFFSET($U$1,,9),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,10)),MID(OFFSET($U$1,,10),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,11)),MID(OFFSET($U$1,,11),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,12)),MID(OFFSET($U$1,,12),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,13)),MID(OFFSET($U$1,,13),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,14)),MID(OFFSET($U$1,,14),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,15)),MID(OFFSET($U$1,,15),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,16)),MID(OFFSET($U$1,,16),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,17)),MID(OFFSET($U$1,,17),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,18)),MID(OFFSET($U$1,,18),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,19)),MID(OFFSET($U$1,,19),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,20)),MID(OFFSET($U$1,,20),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,21)),MID(OFFSET($U$1,,21),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,22)),MID(OFFSET($U$1,,22),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,23)),MID(OFFSET($U$1,,23),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,24)),MID(OFFSET($U$1,,24),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,25)),MID(OFFSET($U$1,,25),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,26)),MID(OFFSET($U$1,,26),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,27)),MID(OFFSET($U$1,,27),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,28)),MID(OFFSET($U$1,,28),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,29)),MID(OFFSET($U$1,,29),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,30)),MID(OFFSET($U$1,,30),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,31)),MID(OFFSET($U$1,,31),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,32)),MID(OFFSET($U$1,,32),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,33)),MID(OFFSET($U$1,,33),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,34)),MID(OFFSET($U$1,,34),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,35)),MID(OFFSET($U$1,,35),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,36)),MID(OFFSET($U$1,,36),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,37)),MID(OFFSET($U$1,,37),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,38)),MID(OFFSET($U$1,,38),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,39)),MID(OFFSET($U$1,,39),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,40)),MID(OFFSET($U$1,,40),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,41)),MID(OFFSET($U$1,,41),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,42)),MID(OFFSET($U$1,,42),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,43)),MID(OFFSET($U$1,,43),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,44)),MID(OFFSET($U$1,,44),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,45)),MID(OFFSET($U$1,,45),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,46)),MID(OFFSET($U$1,,46),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,47)),MID(OFFSET($U$1,,47),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,48)),MID(OFFSET($U$1,,48),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,49)),MID(OFFSET($U$1,,49),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,50)),MID(OFFSET($U$1,,50),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,51)),MID(OFFSET($U$1,,51),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,52)),MID(OFFSET($U$1,,52),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,53)),MID(OFFSET($U$1,,53),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,54)),MID(OFFSET($U$1,,54),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,55)),MID(OFFSET($U$1,,55),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,56)),MID(OFFSET($U$1,,56),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,57)),MID(OFFSET($U$1,,57),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,58)),MID(OFFSET($U$1,,58),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,59)),MID(OFFSET($U$1,,59),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,60)),MID(OFFSET($U$1,,60),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,61)),MID(OFFSET($U$1,,61),13,6)*1,IF($I2<SUM(OFFSET($U2,,1,,62)),MID(OFFSET($U$1,,62),13,6)*1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))"
|