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
-
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
-
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.
-
Thank you!
-
Glad I could help.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.9K Get Help
- 474 Global Discussions
- 207 Use Cases
- 517 Announcements
- 5.5K Ideas & Feature Requests
- 87 Brandfolder
- 157 Just for fun
- 83 Community Job Board
- 521 Show & Tell
- 36 Member Spotlight
- 3 SmartStories
- 309 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!