Forum Discussion

jaolvera's avatar
jaolvera
Brass Contributor
Jul 18, 2023

Total months Formula

Hello! 

Is there a formula I could use for each cell listed by month (see photo) that I could use that would total the amount of times each month was referenced in a range of dates.

Ex. lets say Colum A has 30 dates in mm/dd/yyyy format, and I would want to know the number of times January month was referenced, February was referenced, etc....

Thank you!

    • jaolvera's avatar
      jaolvera
      Brass Contributor
      thank you! I am creating a dashboard that will reference another sheet that contains data and I want the dashboard to update as data is inputted, will this pivot table auto update as data gets imputed?
      • mathetes's avatar
        mathetes
        Silver Contributor

        jaolvera

         

        It doesn't do it passively. However, so long as it's drawing from the same Table of data, all you need to do is click on the Refresh All button on the Data tool bar

        If you haven't already done so, I recommend clicking on the link embedded in the words  "Pivot Table" in my first reply to you. That will take you to a valuable resource explaining more about Pivot tables, which over recent decades have been one of the most widely used of Excel tools.

  • peiyezhu's avatar
    peiyezhu
    Bronze Contributor
    =COUNTIFS(A2:A10,">="&DATE(year,month,1),A2:A10,"<="&DATE(year,month+1,1)-1)
    • jaolvera's avatar
      jaolvera
      Brass Contributor
      besides changing the cell range was anything else supposed to be changed in this formula? all I get are 0 for the totals
      • peiyezhu's avatar
        peiyezhu
        Bronze Contributor
        =COUNTIFS(A2:A10,">="&DATE(2023,1,1),A2:A10,"<="&DATE(2023,1+1,1)-1)

        data
        A
        date
        2023-01-15

Resources