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
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!