Invalid data type error

Hi,


My formula is =COUNTIF({Range 1}, AND(MONTH(@cell) = 3)) and i am trying to count the number of dates in march. my date column (Range 1) is 03/01/22

I am getting a invalid data type error.


thanks for your help.

Peggy

Best Answer

  • Kelly Moore
    Kelly Moore Community Champion
    Answer ✓

    Hey @Peggy

    To clarify, your Range 1 is the entire Date column, correct? It shouldn't be just a single cell. If it is the single cell, delete the Range 1 completely from this formula, click the Insert Reference and go back to the source sheet and insert the entire column by clicking the column header.

    Try this

    =COUNTIFS({source sheet entire date column}, IFERROR(MONTH(@cell),0)=3)

    I added an IFERROR in the event a non-date was in your date column. This will prevent the cell from causing the entire calculation to fail.

    Kelly

Answers

  • Kelly Moore
    Kelly Moore Community Champion
    Answer ✓

    Hey @Peggy

    To clarify, your Range 1 is the entire Date column, correct? It shouldn't be just a single cell. If it is the single cell, delete the Range 1 completely from this formula, click the Insert Reference and go back to the source sheet and insert the entire column by clicking the column header.

    Try this

    =COUNTIFS({source sheet entire date column}, IFERROR(MONTH(@cell),0)=3)

    I added an IFERROR in the event a non-date was in your date column. This will prevent the cell from causing the entire calculation to fail.

    Kelly

  • Peggy
    Peggy ✭✭✭✭✭

    To clarify, your Range 1 is the entire Date column, correct?  correct

    this worked, thank you Kelly!!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!