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
 

Some videos you may like

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
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
199
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
Joined
Oct 31, 2008
Messages
2,672

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
10,687
Office Version
2019
Platform
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

Board Regularmmmm Pizza
Joined
Oct 31, 2008
Messages
2,672
Also
Excel Workbook
ABCD
1AABTRUE
2ABCFALSE
Sheet1
Excel 2003
Cell Formulas
RangeFormula
D1=COUNTIF(A1:C1,A1)>1
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

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

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top