Nested If

starnold

Board Regular
Joined
Feb 4, 2004
Messages
57
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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
=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 :/
 
Upvote 0
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
 
Upvote 0
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)
 
Upvote 0
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
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,214,565
Messages
6,120,254
Members
448,952
Latest member
kjurney

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top