简体   繁体   中英

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. 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.

这是桌子

The value that I'm looking for is 1.6910878023

This would be the manual way of solving it.
[ROW 16 RATE: 1.691 , AMOUNT: 123746 ]
[ROW 18 RATE: 1.692 , AMOUNT: 11911 ]

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

Is this possible? LOL

THANK YOU VERY MUCH GUYS!

Use SUMPRODUCT

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

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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