Forum Discussion

rhockman's avatar
rhockman
Brass Contributor
May 28, 2020
Solved

Counting Dates

If I have multiple dates in a single cell, Can I use a formula to count the dates by month?  For Example if I have these dates in the single cell 9/4/2019, 9/5/2019, 11/6/2019, 11/7/2019, can I count the number of Septembers (2) and Novembers (2).  TY for the help, it is much appreciated.

  • rhockman 

     

    Excel 2013 and later:

     

    =SUMPRODUCT(0+(TEXT(FILTERXML("<a><b>"&SUBSTITUTE(A1,",","</b><b>")&"</b></a>","//b"),"mmmm")="September"))

     

    Amend month as required.

     

    Slightly more involved if you're on a pre-2013 version of Excel. Let me know.

     

    Regards

     

     

     

     

10 Replies

  • Jos_Woolley's avatar
    Jos_Woolley
    Iron Contributor

    rhockman 

     

    Excel 2013 and later:

     

    =SUMPRODUCT(0+(TEXT(FILTERXML("<a><b>"&SUBSTITUTE(A1,",","</b><b>")&"</b></a>","//b"),"mmmm")="September"))

     

    Amend month as required.

     

    Slightly more involved if you're on a pre-2013 version of Excel. Let me know.

     

    Regards

     

     

     

     

  • wumolad's avatar
    wumolad
    Iron Contributor

    Hi rhockman 

     

    I suggest you extract the dates out first using text to column and then use functions to determine the month in each date.

     

    Cheers

Resources