James M.
James M.

Reputation: 3

Powerpivot - Create flag if the row value of one column exists anywhere in another column

What I'm trying to accomplish doesn't seem too tricky, and should be doable I just can't seem to crack it.

All I need to do is create a calculated column that flags whether or not the row value in one column exists anywhere in another column within the same table.

  id | Code 1        | Code 2         | Attempted results
--------------------------------------------------------------------------
   1 | 1095829       | 1093895        | Y               
   2 | 1093895       | 1838949        | N               
   3 | 1095289       | 1093910        | Y               
   4 | 1093910       | 1840193        | N    

So essentially, is Code 1 found anywhere in the code 2 column

Upvotes: 0

Views: 183

Answers (1)

Steve Smith
Steve Smith

Reputation: 168

You should be able to do this using an IF/MATCH formula. For example:

=IF(MATCH(B2,C:C,0),"Duplicate", "Unique")

This would check if B2 (1095829) shows up anywhere in the C column. If it does, it returns "Duplicate" to that cell, if it does not, then it returns "Unique".

Upvotes: 1

Related Questions