I am working on creating a formula for a series of cells that will show rolling data in a specific category for the current month plus the previous 12 months. Because of the rolling nature, I need to be able to use “end-of-month” as part of the formula for the ending date of the month for each cell to search (unless there’s a better way?). Here’s what I came up with so far (in the first cell behind Current Month, which would currently be May), but it’s not returning an accurate count. It’s giving me “52,” when it should be giving me “30“. Any ideas what I’m doing wrong here?
=COUNTIFS('E-Mail Log'!A:A,">="&DATE(YEAR(TODAY()),MONTH(TODAY())-1,1),'E-Mail Log'!A:A,"<="&DATE(YEAR(TODAY()),MONTH(TODAY())-1,EOMONTH(TODAY(),-1)))
Regarding another approach, what if I were to simply use the date “31” as the stopping point for the search instead of trying to figure the EOM? Would this cause any issues in the months that have less than 31 days? I added the formula to test out a couple of these months which returned accurate answers, but are there any unforeseen issues this can cause? The formula works, and looks like this (for one month back):
=COUNTIFS('E-Mail Log'!A:A,">="&DATE(YEAR(TODAY()),MONTH(TODAY())-1,1),'E-Mail Log'!A:A,"<="&DATE(YEAR(TODAY()),MONTH(TODAY())-1,31))
Any help or suggestions would be truly appreciated =)
=COUNTIFS('E-Mail Log'!A:A,">="&DATE(YEAR(TODAY()),MONTH(TODAY())-1,1),'E-Mail Log'!A:A,"<="&DATE(YEAR(TODAY()),MONTH(TODAY())-1,EOMONTH(TODAY(),-1)))
Regarding another approach, what if I were to simply use the date “31” as the stopping point for the search instead of trying to figure the EOM? Would this cause any issues in the months that have less than 31 days? I added the formula to test out a couple of these months which returned accurate answers, but are there any unforeseen issues this can cause? The formula works, and looks like this (for one month back):
=COUNTIFS('E-Mail Log'!A:A,">="&DATE(YEAR(TODAY()),MONTH(TODAY())-1,1),'E-Mail Log'!A:A,"<="&DATE(YEAR(TODAY()),MONTH(TODAY())-1,31))
Any help or suggestions would be truly appreciated =)