What am I doing wrong?

Trying to count how many of a certain type of ticket was opened in a specific month.

I have this to count the specific ticket type (which does work):

=COUNT([Reference #]:[Reference #])

I have this to count all ticket opened in January (also works):

=COUNTIF([Date Opened]:[Date Opened], IFERROR(MONTH(@cell ), 0) = 1)

I have tried this to try to count the number of reference tickets in the month of January, comes back #UNPARSEABLE :

=COUNTIF([Reference #]:[Reference #],([Date Opened]:[Date Opened], IFERROR(MONTH(@cell ), 0) = 1))

and this comes back #INCORRECT ARGUMENT SET:

=COUNTIF([Reference #]:[Reference #], [Date Opened]:[Date Opened], IFERROR(MONTH(@cell ), 0) = 1)

Best Answer

  • KPH
    KPH Community Champion
    Answer βœ“

    If you want to count rows that meet more than one criteria, then you will need to use a COUNTIFS function, not COUNTIF

    See:

    COUNTIFS Function | Smartsheet Learning Center

    In the COUNTIFS you will need two pairs of ranges and criteria. The Date Opened and month will work as one pair, so start with:

    =COUNTIFS( [Date Opened]:[Date Opened], IFERROR(MONTH(@cell ), 0) = 1)

    That will return the rows with January Date Opened.

    Then add in a range and criteria for the Reference #.

    [Reference #]:[Reference #]

    Will be the range. I've put 001 as the criteria for now.

    =COUNTIFS( [Date Opened]:[Date Opened], IFERROR(MONTH(@cell ), 0) = 1,[Reference #]:[Reference #],"001")

    This will return a count for rows where the reference # is 001 and the date opened is January

    You can replace the 001 with whatever reference you want.

    Your first formula (=COUNT([Reference #]:[Reference #])) is counting all rows with data in [Reference #] not a specific reference number.

Answers

  • KPH
    KPH Community Champion
    Answer βœ“

    If you want to count rows that meet more than one criteria, then you will need to use a COUNTIFS function, not COUNTIF

    See:

    COUNTIFS Function | Smartsheet Learning Center

    In the COUNTIFS you will need two pairs of ranges and criteria. The Date Opened and month will work as one pair, so start with:

    =COUNTIFS( [Date Opened]:[Date Opened], IFERROR(MONTH(@cell ), 0) = 1)

    That will return the rows with January Date Opened.

    Then add in a range and criteria for the Reference #.

    [Reference #]:[Reference #]

    Will be the range. I've put 001 as the criteria for now.

    =COUNTIFS( [Date Opened]:[Date Opened], IFERROR(MONTH(@cell ), 0) = 1,[Reference #]:[Reference #],"001")

    This will return a count for rows where the reference # is 001 and the date opened is January

    You can replace the 001 with whatever reference you want.

    Your first formula (=COUNT([Reference #]:[Reference #])) is counting all rows with data in [Reference #] not a specific reference number.

  • CatB
    CatB ✭✭
  • KPH
    KPH Community Champion

    Glad I could help.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!