EXCEL里如何实现根据现在日期所在的月份进行动态数据计算?

2024-11-16 06:58:15
推荐回答(5个)
回答(1):

1问可以用公式:=SUM(A1:INDIRECT("A"&MONTH(TODAY())))
2问可以用公式:=INDIRECT("A"&MONTH(TODAY()))

如果是A1 B1 C1 D1 E1 F1
1问可以用公式:=SUM(INDIRECT("A1:"&INDEX({"A1","B1","C1","D1","E1","F1"},MONTH(TODAY()))))
2问可以用公式:=INDIRECT(INDEX({"A1","B1","C1","D1","E1","F1"},MONTH(TODAY())))

回答(2):

A1-A12分别代表1-12月的数值
1、自动计算当前日期所在的月份进行累加(累加1月到本月的数值)
=SUM(INDIRECT("a1:a"&MONTH(NOW())))
2、显示当月的数值是多少
=INDIRECT("a"&MONTH(NOW()))

回答(3):

用index函数也行
=SUM(A1:INDEX(A1:A7,MONTH(NOW()),1))

=INDEX(A1:A6,MONTH(NOW()),1)

回答(4):

用offset()函数,
提示1:=sum(offset(A1,0,0,1,month(today())));
提示2:=offset(A1,0,(month(today())-1))。

回答(5):

1问题:=SUM(INDIRECT("A1:"&ADDRESS(MONTH(TODAY()),1,4,1),1))
2问题:=INDIRECT(ADDRESS(MONTH(TODAY()),1,4,1),1)
补充:=SUM(INDIRECT("A1:"&ADDRESS(1,MONTH(TODAY()),4,1),1))
=INDIRECT(ADDRESS(1,MONTH(TODAY()),4,1),1)