Compare two columns and return a yes or no
I have two columns on one sheet that I want to compare. If the value in Column A matches any value in Column B, I want a yes to be returned in Column C. I've played with the formula for over an hour and can't get it right.
=IF(CONTAINS([RDS Serial #]@row, [Serial Number]:[Serial Number]), "YES", "NO")
Best Answers
-
Hey @BerryC
Here's an alternative approach
=IF([RDS Serial #]@row <> "", IF(COUNTIFS([Serial Number]:[Serial Number], [RDS Serial #]@row, [Serial Number]:[Serial Number], <>"") > 0, "Yes", "No"))
Will this work for you?
Kelly -
The UNPARSEABLE error might just be a minor syntax issue. I input the HAS formula in a sheet with your example data and it seems to work fine.
Answers
-
Hey @BerryC
Try the HAS function instead
=IF(HAS([Serial Number]:[Serial Number], [RDS Serial #]@row), "YES", "NO")
Does this work for you?
-
I get an UNPARSEABLE error
-
Hey @BerryC
Here's an alternative approach
=IF([RDS Serial #]@row <> "", IF(COUNTIFS([Serial Number]:[Serial Number], [RDS Serial #]@row, [Serial Number]:[Serial Number], <>"") > 0, "Yes", "No"))
Will this work for you?
Kelly -
Could you tell us what error you are getting specifically? The formula is correct, so I do not think that is the issue.
I remade it and it worked using the exact same format so it may be another cause:
Renée Roberge
-
Hi Kelly,
It kind of works. My two columns will not have the values directly across from each other. When the two columns are populated, I get a yes, but when the columns don't make the no value is not returned.
-
When I run the formula provided by Kelly, it works perfectly when the RDS Serial# and Serial Number match; I get a Yes in the box next to the column with the RDS Serial # populated. However, if the RDS Serial # is not populated, I get no Return.
-
The UNPARSEABLE error might just be a minor syntax issue. I input the HAS formula in a sheet with your example data and it seems to work fine.
-
Try this
=IF(COUNTIFS([Serial Number]:[Serial Number], [RDS Serial #]@row, [Serial Number]:[Serial Number], <>"") > 0, "Yes", "No")
Kelly
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.9K Get Help
- 410 Global Discussions
- 219 Industry Talk
- 457 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 136 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!