Count IFS & Contains
I'm trying to count the number of times a specific string of text is referenced in a column on another sheet. I've tried multiple ways, but it doesn't seem to come out right -
=COUNTIFS({KPHI: SHP Master Patient Tracker_ProcType}, "TAVR", {KPHI: SHP Master Patient Tracker_Comp@Proc}, CONTAINS("Arrhythmia, 1st Degree AV Block", @cell)) - Results in 0 (which is fine; however, I want the "TAVR" and "Arrhythmia, 1st Degree AV Block" to be referenced cells vs hard coded.
When I use, =COUNTIFS({KPHI: SHP Master Patient Tracker_ProcType}, =$IndexID$24, {KPHI: SHP Master Patient Tracker_Comp@Proc}, CONTAINS(=[Primary Column]@row, @cell)), I get the #INVALIDOPERATION error.
What am I doing wrong?
I'm trying to create a formula that counts if
- The reference sheet, Procedure Type = TAVR
- The reference sheet, Procedure Date = In the Past
- The reference sheet, Complications contains the @cell value
Please help
Answers
-
Hello @raymond.j.riosiii94806
I can spot a reason for the invalid operation error on the second formula:
=COUNTIFS({KPHI: SHP Master Patient Tracker_ProcType}, =$IndexID$24, {KPHI: SHP Master Patient Tracker_Comp@Proc}, CONTAINS(=[Primary Column]@row, @cell))
Try removing the additional "=" signs as they aren't needed.
There should only be one "=" at the beginning, having more will result in errors.
For the first formula:
I haven't tested this out but it would be helpful to see a screen shot of the referenced sheet and the columns you're trying to work with.
=COUNTIFS({KPHI: SHP Master Patient Tracker_ProcType}, "TAVR", {KPHI: SHP Master Patient Tracker_Comp@Proc}, CONTAINS([TAVR Complication Statistics]@row, @cell))
If you're still having issues with this perhaps the "@cell" portion can reference the row instead.
Perhaps removing the CONTAINS portion will reference the row directly without any hardcoding:
=COUNTIFS({KPHI: SHP Master Patient Tracker_ProcType}, "TAVR", {KPHI: SHP Master Patient Tracker_Comp@Proc}, [TAVR Complication Statistics]@row)https://www.linkedin.com/in/zchrispalmer/
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!