Loop through 2 columns and and return TRUE or FALSE if adjscent cells are matching.

strongman86

Board Regular
Joined
Feb 15, 2017
Messages
95
Hi lads,

Need formula in cell E1 that loops through Columns A & C and if cell value is identical i.e. AB1234X vs AB1234X then it need to compare corresponding adjscent cell values in column B & D to see if they are matching. If they are matching then it needs to return TRUE if not matching then FALSE.



ABCDE
1AB1234X2.40AD2456Y0.24FALSE
2AU1336X1.20AB1234X2.40TRUE
3AD2456Y0.20ZN3590Q1.54TRUE
4TR3456U5.50AU1336X1.20TRUE
5ZN3590Q1.54TR3456U5.52FALSE


<tbody>
</tbody>


Regards,
Strongman86
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,125
Office Version
365
Platform
Windows
How about
=ISNUMBER(MATCH(C2&"|"&D2,INDEX($A$2:$A$6&"|"&$B$2:$B$6,0,0),0))
 

strongman86

Board Regular
Joined
Feb 15, 2017
Messages
95
Hi Fluff, Works ok, but I've noticed sometimes some cells in column C has space after text and then formula doesn't work. Can you amend formula so it looks only for first 7 characters? Thanks.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,125
Office Version
365
Platform
Windows
How about
=ISNUMBER(MATCH(LEFT(C2,7)&"|"&D2,INDEX(LEFT($A$2:$A$6,7)&"|"&$B$2:$B$6,0,0),0))
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
35,504
Office Version
2010
Platform
Windows
Hi Fluff, Works ok, but I've noticed sometimes some cells in column C has space after text and then formula doesn't work. Can you amend formula so it looks only for first 7 characters? Thanks.
If the spaces could only be in Column C (not Column A) then this formula should work for you...

=COUNTIFS(A$1:A$5,TRIM(C1),B$1:B$5,D1)>0

Adjust the 5 in the A$5 and B$5 to be the last row number for your data.
 
Last edited:

Forum statistics

Threads
1,081,793
Messages
5,361,325
Members
400,627
Latest member
Mcomeaux

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top