Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Finding same value in different rows in two columns

JeremyZ
7 - Meteor

Hi all, 

 

Does anyone know how to find same value in different rows in two columns?

Here if the value in "Ref1" column in first row matches the value in "Ref2" column in second row, I will add "match" to the "Comments" column for both two rows.

The same value cannot appear in the same row.

 

Original:

Ref1 Ref2Comments
12345678 
01231234 
ABCEFGH 
XYZWABCDEF 
EFGHABCD 

 

Desire result:

Ref1 Ref2Comments
12345678match
01231234match
ABCEFGHmatch
XYZWABCDEF 
EFGHABCDmatch
10 REPLIES 10
aisha002
5 - Atom

To find the same value in different rows in two columns, you can use a combination of Excel functions. One way to do this is by using the "IF" and "COUNTIF" functions. First, create a new column next to the two columns you want to compare. In the first cell of the new column, use the formula: "=IF(COUNTIF(A:A,B1)>0,"Match","No match")". This formula compares the value in cell B1 to the values in column A and returns "Match" if it finds a match, or "No match" if it doesn't. You can then drag the formula down the entire column to compare all the values in column B to the values in column A. This method can help you quickly identify any matching values between the two columns.

Labels