Home > Software design >  Average ifs based on column and row in excel/google sheet
Average ifs based on column and row in excel/google sheet

Time:11-24

So I have this table:

enter image description here

I added 1.5 in B11 and 5 in B12 manually but what formula should I type to get the average for before or equal and after a given date?

CodePudding user response:

The way you currently have it set up, you can use INDEX/MATCH to return the row you're looking for, supply that to AVERAGEIFS, and match the date against the first row:

=averageifs(index(A1:E4, match(B9, A1:A4, 0)), A1:E1, "<=" &B10)
=averageifs(index(A1:E4, match(B9, A1:A4, 0)), A1:E1, ">" &B10)

See this demo on Google Sheets, but the formulas should be the same for Excel:

enter image description here

  • Related