# Nested If

#### starnold

##### Board Regular
I am trying to compare data across columns and tell me if they results match

Col1 Col2 Col3 Col4
1 1 2 1
1 1 1 1

What I want to see is a TRUE or FALSE to say the data in all columns match

First row would be false as Col3 doesn't match with the others but the 2nd row would match

### Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

#### -Wayner-

##### Board Regular
=IF(AND(A2=B2,B2=C2,C2=D2),"True","False")

Would Work assuming you always have 4 columns (if not change the 4) Assumes data is in columns A - D and starts in row 2.

EDIT: Changed that, first one wouldn't have worked :/

#### dcofer

##### Board Regular
Are there always only 4 columns?

If so, this formula is a little long, but will work.

=IF(A1=B1,IF(B1=C1,IF(C1=D1,"True","False")))

There are others here who can probably provide a better and shorter solution.

Hope this helped.

---dave

#### Sandeep Warrier

##### Board Regularmmmm Pizza

If they are all numbers then try
Excel Workbook
ABCDE
11121FALSE
21111TRUE
Sheet1
Excel 2003
Cell Formulas
RangeFormula
E1=COUNTIF(A1:D1,A1)=COUNT(A1:D1)

#### starnold

##### Board Regular
Is there a way to say TRUE if any of the columns match the first column?

So using the below example only the first second row would be TRUE as Col2 matches Col1

Col1 Col2 Col3
A A B
A B C

#### jasonb75

Excel Workbook
ABCDE
1AABTRUE
2ABCFALSE
Sheet

##### Well-known Member
Is there a way to say TRUE if any of the columns match the first column?

So using the below example only the first second row would be TRUE as Col2 matches Col1

Col1 Col2 Col3
A A B
A B C
Are you mixing up rows and columns in your question? Col One has A in row 1 and 2, Col 2 Has A in row 1 and B in row 2 so Row 2 in Col 1 matches Row 1 ini col 2, and in Col 2 Row 2 the B should surely match col 3 row 1? both are B using the same logic?

Excel Workbook
MNOP
105abcTRUE
106aabFALSE
Course Dates
Excel Workbook
P
106FALSE
Course Dates

#### Sandeep Warrier

##### Board Regularmmmm Pizza
Also
Excel Workbook
ABCD
1AABTRUE
2ABCFALSE
Sheet1
Excel 2003
Cell Formulas
RangeFormula
D1=COUNTIF(A1:C1,A1)>1

1,106,635
Messages
5,512,528
Members
408,902
Latest member