0
votes

I have a spreadsheet (Office 365 Pro) that has numeric data in multiple columns. I want to average data in those columns if specific multiple criteria is met in other columns.

For example, one formula that is in use:

=AVERAGEIFS(K:K,C:C, ">=01/01/2021", C:C, "<=1/31/2021")

This formula works exactly the way I want, for the data specifically only in column K.

I want to accomplish what this formula does, but to include columns K through P, and not K only.

I tested a simple average formula which worked fine across multiple columns

=AVERAGE(K:P)

I can't figure out how to average data in all of those columns based on the criteria in my other formula.

If I simply change the column to average to:

=AVERAGEIFS(K:P,C:C, ">=01/01/2021", C:C, "<=1/31/2021")

I get a #VALUE error.

Any suggestions on how to accomplish this?

1

1 Answers

1
votes

use FILTER:

=AVERAGE(FILTER(K:P,(C:C>=DATEVALUE("01/01/2021"))*(C:C<=DATEVALUE("1/31/2021"))))