dynamic最大/最小matrix基于列表中的比例
我有以下Excel表格:
ABC 1 Product Discount Proportion of Discount 2 Product A 85% 3 Product B 85% 33% --> 33% of the products have discount of 85% 4 Product C 75% 17% --> 17% of the products have discount of 75% 5 Product D 70% 17% --> 17% of the products have discount of 70% 6 Product E 50% 7 Product F 50% 33% --> 33% of the products have discount of 50% 8
在A栏可以find不同的产品, B栏的折扣和C栏的折扣在列表中的比例。
现在我想有一个公式,做以下几点:
公式应按C列并按比例总结比例 – 按B列 – 折扣最高的产品开始 – 直至达到总比例 至less60% 。 在上面的例子中,这将意味着:
Product A&B (33%) + Product C (17%) + Product D (17%) = 67%
一旦公式达到了这个60%的最小比例,它就定义了matrix来获得最大值或最小值(折扣)。 在上面的例子中,这将意味着:
MATRIX = B2:B5 (Product A&B, Product C, Product D)
最后这个matrix用于MAX或MIN公式:
=MAX/MIN(B2:B5)
你有什么想法,我可以用来解决这个问题的公式?
就像是:
= Once SUM(C2:C7) reaches at least 60% then use the matrix resulting from the values in the 60% sum (B2:B5)
再添加一列(从D2开始),公式如下:
=IF(AND(D1<0.6,D1>=0),SUM(C$2:C2),-1)
然后计算使用该列作为标准
=MAXIFS(B2:B10,D2:D10,">0")/MINIFS(B2:B10,D2:D10,">0")
如果您不能使用MAXIFS / MINIFS公式(对于早期版本的Excel),则在D2中input:
=IF(D1<0.6, SUM(C$2:C2), "")
结果是这样的(用ctr + shift + enter确认,不只是input):
=MAX(IF(D2:D10<>"", B2:B10))/MIN(IF(D2:D10<>"", B2:B10))
公式周围必须出现大括号{}(您不能手动input)。