Formulas and Functions

Formulas and Functions

Ask for help with your formula and find examples of how others use formulas and functions to solve a similar problem.

Count the dates in the current month

I have a list of dates in a column on a sheet. I am looking for a formula that would count only the dates in the current month and year, e.g., November for now and next month it should show the count for December 2022. It would be greatly appreciated if someone could help me out here.

Best Answer

  • Community Champion
    Answer ✓

    Hey @Asha Krishnan

    I will assume the formula is looking only at your current sheet and not bringing data in from a different sheet. The format of the formula changes slightly if using cross-sheet references.

    =COUNTIFS([your date column]:[your date column],AND(ISDATE(@cell), YEAR(@cell)=YEAR(TODAY()), MONTH(@cell)=MONTH(TODAY()))

    I added the ISDATE (which means only cells that have real dates in them will be evaluated) to help prevent any data errors. Be sure to change the [your date column] to match your actual column name

    Will this work for you?

    Kelly

Answers

  • Community Champion
    Answer ✓

    Hey @Asha Krishnan

    I will assume the formula is looking only at your current sheet and not bringing data in from a different sheet. The format of the formula changes slightly if using cross-sheet references.

    =COUNTIFS([your date column]:[your date column],AND(ISDATE(@cell), YEAR(@cell)=YEAR(TODAY()), MONTH(@cell)=MONTH(TODAY()))

    I added the ISDATE (which means only cells that have real dates in them will be evaluated) to help prevent any data errors. Be sure to change the [your date column] to match your actual column name

    Will this work for you?

    Kelly

  • ✭✭✭✭

    @Kelly Moore Yes, your formula did the job. Thank you so much for your help!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!

Trending in Formulas and Functions