Excel和值如果月份等于值 [英] Excel sum value if month equals value

查看:142
本文介绍了Excel和值如果月份等于值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该函数需要遍历单元格,如果值为正确的月份(8,9等),则需要添加另一个单元格的值。我所有的日期都在B3:B300内,所有的总计都在K3:K300之内。

The function needs to iterate through the cells and if the value is the right month (8, 9, etc.), then it needs to add the value of another cell. All of my dates are within B3:B300, and all of my totals arew within K3:K300.

例如:

A1      A2       A3
8/8/14  8/10/14  9/10/14

B1      B2       B3
20      40       30

如果我在寻找8月份的金额,在这个例子中将是60。

If I was looking for the sum for August, in this example it would be 60.

这是我尝试的公式,但没有得到所需的结果:

This is the formula I attempted, but didnt get the desired results:

=SUM(IF(--(MONTH('Transaction Financials'!B3:B300))=8,--('Transaction Financials'!K3:K300),0))


推荐答案

=SUMPRODUCT(--(MONTH(A2:A4) = 8), B2:B4)

这篇关于Excel和值如果月份等于值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆