# 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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

#### -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

##### Well-known Member

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

##### Well-known Member
Also
Excel Workbook
ABCD
1AABTRUE
2ABCFALSE
Sheet1
Excel 2003
Cell Formulas
RangeFormula
D1=COUNTIF(A1:C1,A1)>1

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,168,109
Messages
5,857,439
Members
431,879
Latest member
KiwDaWabbit

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back