You do not need JS for this. You can do this with built-in spreadsheet formulas.
It looks like you need a similar answer that I gave to this question , with the difference that you are checking two columns instead of one.
Do you want to:
=if(AND(COUNTIF($A$1:$A2,A2)=1, COUNTIF($B$1:$B2,B2)=1), "", "Yes")
A key note is the use of AND forumla.
This will fill up and look like this:
=if(AND(COUNTIF($A$1:$A3,A3)=1, COUNTIF($B$1:$B3,B3)=1), "", "Yes") =if(AND(COUNTIF($A$1:$A4,A4)=1, COUNTIF($B$1:$B4,B4)=1), "", "Yes") ...
And these are the results, using your table data as an example. Does this suggest that the formula was inserted into the Duplicate? (C2) and filled in:
ABC 1 Contact Name Duplicate? 2 email@example.com John 3 repeat.email@example.com Repeated Name 4 repeat.email@example.com Jane Yes 5 email3@example.com Repeated Name Yes
Jonathan wren
source share