Reputation: 999
I have two tables in excel, I want compare if the two min and max columns are a match, the two keys are DivApt and ID. If they match, assign yes, otherwise no.
Table 1:
A B C D
DivApt ID MIN MAX
1600202 68645032054 1374 1374
1600202 65162062750 1873 1873
1600202 406036501 740 740
Table 2:
A B C D
DivApt ID MIN MAX
1600202 456224030 0 0
1600202 30142085140 0 0
1600202 60758077305 0 0
I have tried vlookup and match function and failed, any suggestion?
Upvotes: 0
Views: 1795
Reputation: 71538
Well, if you think it is best to combine the two tables, then that's what I'll suggest.
Copy/paste Table 2 under Table 1:
Run a PivotTable (Under Insert tab), and pick the Tabular form after putting all fields into 'Row Labels':
Remove sub-totals:
And then, you can use a formula like this to do the comparison:
As you can see, the PivotTable already groups the codes and when there is a dissimilarity, it will have a blank cell by default which can be used by the formula to check for differences.
The formula is:
=IF($B4<>"",IF($B5<>"","Yes",""),IF(C4<>C3,"No","Yes"))
Upvotes: 1