Search code examples
excelformula

EXCEL Finding a similar pattern from two tables and comparing results


Say I have two tables

enter image description here

1.I want to search if table 2 has the pattern combination of each row in table 1, (example: row 5 (C5(APPLE) AND D5(APPLE)))

2-1. If table 2 has the pattern combination, I want to compare the results of each row. if the results are the same, return True, else return False (example: compare E5 and E14, E5 is True while E14 is False, therefore return False)

2-2. If table 2 does not have the pattern, return "NOTFOUND"

Question: How do I build a function in G5:G9 that follows this logic?

Edit: To make it more clear refer below:

table 1 , row 1 , apple apple exists in table 2 , but results are different, therefore False.

table 1 , row 2 , apple banana does not exist in table 2, therefore it is Not Found.

table 1 , row 3 , mango banana does not exist in table 2, therefore it is Not Found

table 1 , row 4 , mango pineapple does not exist in table 2, therefore it is Not Found

table 1 , row 5 ,pineapple orange exists in table 2 , results are similar, therefore True.


Solution

  • Try below formula. You may need to array entry means enter the formula with CTRL+SHIFT+ENTER for older versions of excel.

    =IFERROR(AND(INDEX($E$5:$E$9,MATCH(C5&D5,$C$13:$C$17&$D$13:$D$17,0)),(INDEX($E$13:$E$17,MATCH(C5&D5,$C$13:$C$17&$D$13:$D$17,0)))),"NOT FOUND")
    

    enter image description here