Google Sheets – How to Detect Duplicates Across Multiple Sheets

conditional formattingformulasgoogle sheetsgoogle-sheets-data-validationregex

I have found a couple of formulas/scripts for what I am looking for, but they are all locked for one sheet only, thus I will try to explain what exactly I need. I am unable to do it my self, because of my lack of knowledge, so I plead to you to help me out.

I want to have multiple sheets in Google spreadsheet, they can go up to sheet1 to sheet 15, not sure about the number, but they are going to be multiple, and will multiply in the future. So in all the sheets except Sheet1 I will have emails(data), the sheet1 Column D is where in the future I will enter emails, now I want to prevent duplicate entries in Sheet1 collum D by looking in all the sheets I have in that spreadsheet. This is an example if I did not make my self clear sheet1 column D I insert email, press enter, in a case in any other sheet there is that email, I want to show an error, and inability to input the email.

Let me know if this makes sense, and if this is even possible,

This is something that I worked with fine, but it is only for sheet one and column:

=COUNTIF($D$2:$D$D,D2)<1

Also, this is something I tried, to at least mark duplicates, and it did not work.

=countif(indirect("sheet2!A:A"),E2)>1

Best Answer

Here is an example (for illustration) with Conditional Formatting and 3 sheets. The same formula can be used in Data Validation to disable entering of repeating emails.

=(COUNTIF(D:D,D:D)>1)+(REGEXMATCH(D1,TEXTJOIN("|",1,UNIQUE({INDIRECT("Sheet2!D2:D");
                                                            INDIRECT("Sheet3!D2:D")}))))

0

spreadsheet demo