Countifs Formula with 4 ranges is giving me a zero when there are 2 items in the raw data that match
I am using the following formula and getting zero for my result. When I filter the raw data there are 2 items that meet these criteria. I cannot find the error.
=COUNTIFS({Current Performance}, CONTAINS([Primary Column]@row, @cell), {Job Family}, CONTAINS("Sales", @cell), {Month of Entry}, CONTAINS("Jan", @cell), {Year of Entry}, CONTAINS("2022", @cell))
Best Answer
-
Hey @LTK4417
The CONTAINS function is typically used with multiselect columns, or when looking to pull in a textstring that appears in multiple phrases (for example, CONTAINS("Dogs", @cell) would retrieve both "Shaggy Dogs" and "Cuddly Dogs"). Also, almost always quotes shouldn't be used with number values. Quotes confuse smartsheet into thinking the value is a textstring rather than a numeric value.
Is the {Job Family} column a multiselect column (multiple values are allowed in the same cell?). I left the CONTAINS there just in case it was multiselect.
Try this
=COUNTIFS({Current Performance}, [Primary Column]@row, {Job Family}, CONTAINS("Sales", @cell), {Month of Entry}, "Jan", {Year of Entry}, 2022)
Does this work for you?
Kelly
Answers
-
Hey @LTK4417
The CONTAINS function is typically used with multiselect columns, or when looking to pull in a textstring that appears in multiple phrases (for example, CONTAINS("Dogs", @cell) would retrieve both "Shaggy Dogs" and "Cuddly Dogs"). Also, almost always quotes shouldn't be used with number values. Quotes confuse smartsheet into thinking the value is a textstring rather than a numeric value.
Is the {Job Family} column a multiselect column (multiple values are allowed in the same cell?). I left the CONTAINS there just in case it was multiselect.
Try this
=COUNTIFS({Current Performance}, [Primary Column]@row, {Job Family}, CONTAINS("Sales", @cell), {Month of Entry}, "Jan", {Year of Entry}, 2022)
Does this work for you?
Kelly
-
Thank you, Kelly! That worked!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!