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

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
Joined
Feb 8, 2008
Messages
84
=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
Joined
Jun 25, 2004
Messages
200
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
Joined
Oct 31, 2008
Messages
2,676

ADVERTISEMENT

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

Well-known Member
Joined
Dec 30, 2008
Messages
14,791
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

How about
Excel Workbook
ABCDE
1AABTRUE
2ABCFALSE
Sheet
 

scottylad2

Well-known Member
Joined
Feb 2, 2009
Messages
1,919
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?
 

Sandeep Warrier

Well-known Member
Joined
Oct 31, 2008
Messages
2,676
Also
Excel Workbook
ABCD
1AABTRUE
2ABCFALSE
Sheet1
Excel 2003
Cell Formulas
RangeFormula
D1=COUNTIF(A1:C1,A1)>1
 
Master Excel Bundle

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.

Forum statistics

Threads
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.
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
Top