输入1个日期时计算3个月利润的平均值

时间:2019-03-21 17:56:21

标签: excel

我有一张不同供应商的利润表,其日期范围为2017年10月至2018年8月。目的是输入一个月并返回前三个月和随后三个月的平均利润。 (例如,输入FEB 2018,平均收益为2017年DEC 2017,JAN 2019,FEB 2018,也平均收益为FEB,MAR,APR 2018)。尝试过hlookup,但似乎不适用于这种情况。请指教。

screenshot of excel file

    OCT 2017    NOV 2017    DEC 2017    JAN 2018    FEB 2018    MAR 2018    APR 2018    MAY 2018    JUN 2018    JUL 2018    AUG 2018                            
Autozone    " $4,653 "  " $5,584 "  " $8,277 "  " $7,564 "  " $7,321 "  " $6,420 "  " $7,568 "  " $3,546 "  " $9,954 "  " $8,849 "  " $2,325 "                          
Walmart " $9,838 "  " $9,979 "  " $2,655 "  " $4,795 "  " $9,811 "  " $8,179 "  " $7,896 "  " $1,689 "  " $7,244 "  " $8,969 "  " $1,189 "                          
Target  " $8,359 "  " $7,683 "  " $4,607 "  " $4,224 "  " $6,221 "  " $8,519 "  " $5,058 "  " $9,184 "  " $9,699 "  " $1,292 "  " $1,080 "                          
Advanced Auto Parts " $3,674 "  " $4,619 "  " $3,817 "  " $8,741 "  " $9,118 "  " $5,542 "  " $1,578 "  " $9,853 "  " $8,153 "  " $4,710 "  " $4,519 "                  

1 个答案:

答案 0 :(得分:0)

前提:

=AVERAGE(INDEX($2:$5,0,MATCH(H8,1:1,0)):INDEX($2:$5,0,MATCH(H8,1:1,0)-2))

帖子:

=AVERAGE(INDEX($2:$5,0,MATCH(H8,1:1,0)):INDEX($2:$5,0,MATCH(H8,1:1,0)+2))

enter image description here