Forum Discussion
Excel help needed in comparing Data
Hi All
Doc 1 |
|
|
|
|
ID | January | February | March | April |
11 | 1 | 1 | 1 | 1 |
22 | 1 | 1 | 0 | 0 |
|
|
|
|
|
|
|
|
|
|
Doc 2 |
|
|
|
|
ID | January | February | March | April |
11 | 1 | 1 | 1 | 0 |
22 | 0.5 | 1 | 1 | 0 |
|
|
|
|
|
|
|
|
|
|
Results Match ? |
|
|
|
|
ID | January | February | March | April |
11 | Yes | Yes | Yes | No |
22 | No | Yes | No | Yes |
14 Replies
- SergeiBaklanDiamond Contributor
As variant
=IF( INDEX( [Doc1.xlsx]Sheet1!$C$3:$F$4, MATCH($B9,[Doc1.xlsx]Sheet1!$B$3:$B$4,0), MATCH(C$8,[Doc1.xlsx]Sheet1!$C$2:$F$2,0)) = INDEX( $C$3:$F$4, MATCH( $B9, $B$3:$B$4, 0), MATCH( C$8, $C$2:$F$2, 0) ), "Yes", "No" )- Jack67Copper ContributorCan you copy past the content from the attached xls in this reply here ? Also a correction - Instead of having 2 documents Doc1 and Doc2, I actually can put all the content in 1 sheet of a xls.
So consider this as 1 single sheet of a xls with Part 1, Part 2 and then finally the Results- Riny_van_EekelenPlatinum Contributor
Jack67 Isn't that in the file I uploaded earlier?
- bosinanderIron Contributor
Hi Jack67
Assuming not necessary Excel 365 you can use VLOOKUP to lookup the ID in doc 1 and compare with doc 2.
If(same, "Yes", otherwise "No")
=IF(VLOOKUP($A15;$A$3:$E$4;COLUMNS($A:B);0)=VLOOKUP($A15;$A$9:$E$10;COLUMNS($A:B);0);"Yes";"No")Also, attached.
- Riny_van_EekelenPlatinum Contributor
Jack67 See if you can get the formulae as per the attached workbook into your own. I've used named ranges to avoid direct cell references and there are probably several other ways to do it. This, however, was the first that came to mind without giving it much further thoughts.
By the way, the formulae actually result in TRUE or FALSE. With the double dash "--" in front, these become ones and zeroes. These are then custom formatted to display Yes or No.