Google-sheets – How to write an IF-formula with multiple OR/AND arguments to detect duplicates

google sheets

WA90950 question first example

Update2: Changing all commas (,) to semicolons (;) gives me "Could not find a matrix value."

Update1: The formula that Rubén suggests:

=IF(COUNTIF($A$2:A&$B$2:B&$C$2:$C,A2&B2&C2)+COUNTIF($A$2:A&$D$2:D&$E$2:D,A2&D2&E2)>0,1,0)

Gets me this error. Any suggestions?

WA90950 question seond example

I have a Google sheet with 100 rows (individuals) and the following columns:

NAME (A) BIRTHDAY (B) BIRTHPLACE (C) TIME OF DEATH (D) PLACE OF DEATH (E)

I would like to create a formula in a new column (F) that outputs the value 1 if a person has the same NAME, BIRTHDAY and BIRTHPLACE or NAME, TIME OF DEATH and PLACE OF DEATH. Otherwise the output value should be 0.

Is this possible and if yes, how?

Best Answer

Assuming that the first row is used for column headers, add the following formula to F2

=ArrayFormula(    
  IF(
    OR(
      COUNTIF($A$2:A&$B$2:B&$C$2:C,A2&B2&C2)>1,
      COUNTIF($A$2:A&$D$2:D&$E$2:E,A2&D2&E2)>1
    )
  ,1
  ,0
 )
)

Then fill down the above formula as necessary