总计达到同一个月的总数 [英] Sum up totals whose date falls within the same month
问题描述
= SUMIFS(Tracker!A:A,Tracker!B:B,Payment,Tracker!D:D,> =& DATE(2015,01,1) ,Tracker!D:D,&DATE(2015,02,1))
我想拿出上述方程式中的日期的严格编码,而不是说它是大于或等于1月的第一天,而不是二月的第一个,我宁愿说:总结条目这是在A2中的月份和年份之内。
这是我从A2获得月份和年份的代码:
MONTH(A2)& YEAR(A2)
如何使SUMIFS的工作相加在一起A2的年份和年份
只需使用A2中的日期提供 MONTH 和 YEAR 进入 DATE函数。
= SUMIFS(Tracker!A:A,Tracker!B:B,Payment,Tracker!D:D,> =& DATE(YEAR(A2),MONTH(A2) ,1),Tracker!D:D,& DATE(YEAR(A2),MONTH(A2)+1,1))
或者,将 EDA TE功能, EOMONTH功能可以轻松地生成当前日期和前一个月的月底。
In my A2 cell I have this: 01/01/2015
and then I have this equation:
=SUMIFS(Tracker!A:A,Tracker!B:B, "Payment",Tracker!D:D, ">="&DATE(2015, 01, 1),Tracker!D:D, "<"&DATE(2015, 02, 1))
I would like to take out the hardcoding of the date in the above equation, and rather than saying "Is it greater or equal to the first of January and less than the first of February" I would rather say: "Sum up the entries which fall within the month and year in A2".
This is the code I know to get the month and year from A2:
MONTH(A2) & YEAR (A2)
How do I make the SUMIFS work to add up the totals which fall within that same month and year of A2?
Just use the date in A2 to supply the MONTH and YEAR into the DATE function.
=SUMIFS(Tracker!A:A,Tracker!B:B, "Payment",Tracker!D:D, ">="&DATE(YEAR(A2), MONTH(A2), 1),Tracker!D:D, "<"&DATE(YEAR(A2), MONTH(A2)+1, 1))
Alternately, combining the EDATE function with the EOMONTH function could easily generate the end-of-month for the current date and one month previous.
这篇关于总计达到同一个月的总数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!