I'm working in a workbook with two worksheets: one summary tab and one data tab (SQL Results). The data tab is attached and contains the values that the summary tab is aggregating using several SUMPRODUCT formulas.
In the summary tab, the SUMPRODUCT formulas are returning counts of records that meet multiple criteria, as shown in this formula:
cell B5 contains =SUMPRODUCT(('SQL Results'!L:L="I")*('SQL Results'!F:F="201340")*('SQL Results'!I:I="Y")*('SQL Results'!P:P>0.949)*('SQL Results'!T:T<1))
Result is 8 records.
On the Summary tab, I am trying to use AVERAGEIF or IF(...(AVERAGE(...)) to calculate the average of the amounts in Column Y (FUND1_PAID) IF the criteria in the SUMPRODUCT formula are met. My formula seems to be averaging the entire Column Y despite my limiting attempts:
=IF((SUMPRODUCT(('SQL Results'!L:L="I")*('SQL Results'!J:J="1")*('SQL Results'!F:F="201340")*('SQL Results'!I:I="Y")*('SQL Results'!P:P>0.949)*('SQL Results'!T:T<1))),(AVERAGE('SQL Results'!Y:Y)))
This array version isn't quite doing the trick, either. I confirmed with CTRL+SHIFT_ENTER:
=AVERAGE(IF(('SQL Results'!L:L="I")*('SQL Results'!J:J="1")*('SQL Results'!F:F="201340")*('SQL Results'!I:I="Y")*('SQL Results'!P:P>0.949)*('SQL Results'!T:T<1),'SQL Results'!Y:Y))
Any thoughts?
Thank you!
Bookmarks