MrExcel Publishing
Your One Stop for Excel Tips & Solutions

IF (Logical test for more than one cell)


Posted by Andonny on December 22, 2000 2:23 PM

Hi,
I need to compare Cells A1,B1 with A2,B2. If it finds the same name and number it should tell me in cell C1 "duplicate".
Sample:
......A.......B...........C
1....apple...500.......duplicate
2....apple...500
3
4


Posted by SJC on December 22, 2000 3:05 PM

This should work: =IF(A1&B1=A2&B2,"duplicate","")

Posted by GoodFaith on December 23, 2000 10:51 PM

You may use
If(AND(A1=A2,B1=B2),"Duplicate","").

Extra point: If you want to create a condition based on one of two conditions, you may use
If(OR(A1=A2,B1=B2),"Duplicate","").