flatten AVERAGEIF