How to adjust formula for stacked bar chart to use HAS or CONTAINS
I have a stacked bar chart that displays how many initiatives are assigned to an individual by year. (See example below.)
We've recently changed the source sheet from only allowing one year per initiative to allowing for multiple years (for initiatives that span multiple years).
How do I adjust this formula to count if assigned to Valerie in 2025 (if an initiative also lists 2024 and 2026 in the Fiscal Year)? The correct resulting count of this formula should be 1.
=COUNTIFS({TEST President's Cabinet Initiatives Assigned To}, $[Primary Column]@row, {TEST President's Cabinet Initiatives Fiscal Year}, [Column4]$1)
Metrics/helper sheet for stacked bar chart:
Resulting bar chart:
Source sheet:
Any help would be greatly appreciated!
Laura
Best Answer
-
The syntax fo rthe HAS function would be:
=COUNTIFS({TEST President's Cabinet Initiatives Assigned To}, $[Primary Column]@row, {TEST President's Cabinet Initiatives Fiscal Year}, HAS(@cell, [Column4]$1))
Answers
-
The syntax fo rthe HAS function would be:
=COUNTIFS({TEST President's Cabinet Initiatives Assigned To}, $[Primary Column]@row, {TEST President's Cabinet Initiatives Fiscal Year}, HAS(@cell, [Column4]$1))
-
Works perfectly. Thanks so much!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!