I have a spreadsheet with a lot of data columns and a result column beside all of the data. I am trying to create a formula that will give me the average of the results column if the data in the adjacent columns falls within a specified range.
I have this working when I want to put a range on one column of data but am having trouble now with putting the range on multiple columns of data.
My spread sheet looks like this:
In another sheet is all the data, Basically I am trying to get the average of the results when the $FTSEMIB data is between 50 and 0.19 AND the Bank data is between 50 and -15.
I was able to do this by using this averageif:
=AVERAGEIFS(Data!$BHV$10:$BHV$119,Data!$HQ$10:$HQ$119,"<"&G25,Data!$HQ$10:$HQ$119,">"&H25,Data!$TK$10:$TK$119,"<"&G26,Data!$TK$10:$TK$119,">"&H26)
But I realy want to tweak this by using a Lookup or Sumproduct function, that looks up the heading in F25 and F26 then applies the range to them, then averages the adjacent results only if it fits into both ranges.
I tried to do this with this array formula which I had from before when there was only one category to apply the range to but now I am having trouble adding multiple categories
=IFERROR(AVERAGE(IF((Data!$HQ$7:$LZ$7=F$25)*(Data!$HQ$11:$LZ$119>=$H25)*(Data!$HQ$11:$LZ$119<=$G25)*(Data!$BHV$11:$BHV$119<>"")*(Data!$QK$7:$UT$7=F$26)*(Data!$QK$11:$UT$119>=$H26)*(Data!$QK$11:$UT$119<=$G26),Data!$BHV$11:$BHV$119)),"")


Data!$BHV$11:$BHV$119<>""), are those nulls via a formula or truly empty cells with no formula or spaces? - Scott Craner