简体   繁体   English

根据单独的单元格值平均一组单元格值的范围

[英]Averaging a set range of cell values based on a separate cell value

Trying to return an average based on a finite set of values in a range. 尝试根据范围内的一组有限值返回平均值。 The range starting point is determined by a separate cell value. 范围起点由单独的单元格值确定。

If Cell A1 = 3/1/15 I need the average of values beginning with 3/1/15 column, and extending 12 columns. 如果单元格A1 = 3/1/15,我需要以3/1/15列开始并扩展12列的平均值。

Starting date in A2, Avg in B2, List of Date headers in C1:Z1, cell values underneath headers columns. A2中的开始日期,B2中的平均日期,C1:Z1中的“日期”标头列表,标头列下方的单元格值。


https://docs.google.com/spreadsheets/d/1hDPPIWKFUbKiUNvwbbY-6lFp18ujderwgaFSa9OqMEU/edit?usp=sharing https://docs.google.com/spreadsheets/d/1hDPPIWKFUbKiUNvwbbY-6lFp18ujderwgaFSa9OqMEU/edit?usp=sharing

Try using the AVERAGEIFS function, so in cell B2 to calculate the average of cells C2 to Q2 if they are between the value in A2 and 365 days on from the value in A2: 尝试使用AVERAGEIFS函数,因此在单元格B2中计算单元格C2至Q2的平均值(如果它们介于A2中的值和距A2中的值365天之间):

(Adapted using comment from @Scott) (使用@Scott的评论进行了修改)

=AVERAGEIFS(C2:Q2,$C$1:$Q$1,">="&A2,$C$1:$Q$1,"<"&A2+365)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM