count rows that contains certain texts in two different columns
Hi Smartsheet,
I am struggling with a formula that can solve the following issue:
A smartsheet contains multiple columns, two of them (A and B) are texts. I want to count the total number of rows that column A's text contains a text string "XX" OR column B's text contains a text string "YY". Please note, when on a certain row, if column A has "XX" and column B has "YY", it counts as one. In other words, on a certain row, as long as at column A or B has either "XX" or "YY", it will count as one and only one.
I tried "CONTAINS", but it seems not working.
Please help!
Thanks,
Sean
Answers
-
Hi @Shinya
Hope you are fine, please use the following formula:
=COUNTIFS(A:A, CONTAINS("XX", @cell)) + COUNTIFS(B:B, CONTAINS("YY", @cell)) - COUNTIFS(A:A, CONTAINS("XX", @cell), B:B, CONTAINS("YY", @cell))
the following screenshot show the result
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!