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
- 62.3K Get Help
- 364 Global Discussions
- 199 Industry Talk
- 428 Announcements
- 4.4K Ideas & Feature Requests
- 136 Brandfolder
- 127 Just for fun
- 128 Community Job Board
- 445 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 283 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!