Formula to count number of items if it matches both headings.
Hello,
I am currently stuck on this formula. I'm not sure what I'm doing wrong but the formula keeps on providing a return of "1" for everything, when I know I have "2" counts of items which are under category 1 and have a status of in progress.
=COUNT(COLLECT({Status}, $Label@row, {Project Category}, [Category 1]$1))
Any advice would be appreciated! Thank you!!
Best Answer
-
Not sure you need "COLLECT" here (or the fixed reference to the Label column).
Try this instead: =COUNTIFS({Status}, Label@row, {Project Category}, [Category 1]$1)
I created some sample data (including a cross-sheet), and this worked.
Answers
-
Try updating your formula to
=COUNT(COLLECT({Status}, {Status}, $Label@row, {Project Category},[Category 1]$1))
Your COLLECT() function should begin with 2 ranges, one to specify the range you want to collect (then count), then the first range to want to use as criteria. I'm surprised it's returning 1, from what I see you should be return #UNPARSEABLE error with that. Let me know if adding the addition {Status} range fixes it!
You could also use a COUNTIFS() function if the COLLECT() keeps giving you problems.
Jason Tarpinian - Sevan Technology
Smartsheet Aligned Partner
-
Not sure you need "COLLECT" here (or the fixed reference to the Label column).
Try this instead: =COUNTIFS({Status}, Label@row, {Project Category}, [Category 1]$1)
I created some sample data (including a cross-sheet), and this worked.
-
You are awesome! It worked! Thank you!!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.6K Get Help
- 433 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.9K Ideas & Feature Requests
- 143 Brandfolder
- 147 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 298 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!