Excel – Count Date Values of Current Month – MS Excel

excelexcel-formulaformulaformulas

I have following date values (with time) in Column A.

1/1/2012 8:50  
1/1/2012 8:45  
1/1/2012 8:55  
1/1/2012 8:59  
1/1/2012 8:12  
3/1/2012 8:30  
1/1/2012 9:50  
2/1/2012 10:00

Now, I want to get a count of cells from Column A having date values of current Month.

I have thought of following formula, but I suspect it will work only in machines having mm-dd-yyyy as System-Date-Format.

=COUNTIFS(A:A,">="&DATEVALUE(MONTH(TODAY())&"-1"&"-"&YEAR(TODAY())),A:A,"<"&DATEVALUE(MONTH(TODAY())+1&"-1"&"-"&YEAR(TODAY())))

Any workaround/trick for this?

Best Answer

Try this: =SUM(IF(MONTH(TODAY())=MONTH(A:A),1,0)), but press CTRL+SHIFT+ENTER instead of usual ENTER - this will define an ARRAY formula and will result in {} brackets around it (but do NOT type them manually!).

Put the formula in ANY cell you like.

Related Topic