简体   繁体   English

如何使用 excel 数组公式获得取决于数量的平均 RATE?

[英]How to get the average RATE depending on the amount by using excel array formula?

I have been mixing SUM, IF, SUMIFS but still cant get the result that I needed.我一直在混合 SUM、IF、SUMIFS,但仍然无法得到我需要的结果。 This is one of the array formulas that I have tried:这是我尝试过的数组公式之一:

{=(IF(A:A=A8,IF(C:C>0,C:C,0),0)/SUMIFS(C:C,A:A,A8,C:C,">0"))*IF(A:A=A8,IF(B:B>0,B:B,0),0)} 

I need to get the average RATE for 6/18/20 while also factoring how much is the amount on the column 3. Excluding negative values on Column 3. So data that would be needed are the ones on ROWS 16 and 18.我需要获得 2020 年 6 月 18 日的平均 RATE,同时还要考虑第 3 列的数量。不包括第 3 列的负值。因此,需要的数据是第 16 行和第 18 行的数据。

这是桌子

The value that I'm looking for is 1.6910878023我正在寻找的价值是1.6910878023

This would be the manual way of solving it.这将是解决它的手动方法。
[ROW 16 RATE: 1.691 , AMOUNT: 123746 ] [第 16 行汇率: 1.691 ,金额: 123746 ]
[ROW 18 RATE: 1.692 , AMOUNT: 11911 ] [第 18 行汇率: 1.692 ,金额: 11911 ]

=((123746/(123746+11911))*1.691)+((11911/(123746+11911))*1.692) =((123746/(123746+11911))*1.691)+((11911/(123746+11911))*1.692)
= 1.6910878023 = 1.6910878023

Is this possible?这可能吗? LOL哈哈

THANK YOU VERY MUCH GUYS!非常感谢你们!

Use SUMPRODUCT使用 SUMPRODUCT

=SUMPRODUCT(((C14:C20*(C14:C20>0)*(A14:A20=A8))/(SUMIFS(C14:C20,A14:A20,A8,C14:C20,">0")+(B14:B20=0))*(B14:B20)))

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM