Calculate number of rows with current month & year in Google Sheets or Excel

前端 未结 3 1815
天命终不由人
天命终不由人 2021-01-23 15:14

I have one row filled with dates in the format MM/dd/yyyy (with header row), such as:

DATES
5/12/2015
4/12/2012
5/7/2015
5/7/2014

I would like

相关标签:
3条回答
  • 2021-01-23 15:40

    You can use COUNTIFS like this

    =COUNTIFS(A:A,">="&EOMONTH(TODAY(),-1)+1,A:A,"<"&EOMONTH(TODAY(),0)+1)

    That works equally well in Excel or google sheets, for the whole column and will ignore the header row

    0 讨论(0)
  • 2021-01-23 15:59

    In Google sheets you can use

    =COUNT(FILTER(A:A,MONTH(A:A) = MONTH(TODAY()),YEAR(A:A)=YEAR(TODAY())))
    

    Where A:A is the column with your dates

    0 讨论(0)
  • 2021-01-23 16:02

    With data in A1 through A20

    =SUMPRODUCT((MONTH(A1:A20)=MONTH(TODAY()))*(YEAR(A1:A20)=YEAR(TODAY())))
    

    enter image description here

    0 讨论(0)
提交回复
热议问题