# Formula to compare the source and the target based on ID

Source:

``````ID      Entity  Name            Trade Date      Side
88k     BC      66.00           18-Aug-09       S
1391    BED     89.00           18-Aug-09       P
74890   BED     74.00           18-Aug-09       P
74891   BED     ABCD0036        18-Aug-09       S
74893   BED     XFGT0057        18-Aug-09       P
74894   BED     CVBFGR0058      18-Aug-09       P
74895   BED     VVBRTG0041      19-Aug-09       P
74896   BED     FGFGFHC01       19-Aug-09       P
74897   BED     GHGHTGH0183     19-Aug-09       P
``````

Target:

``````ID      Entity  Name            Trade Date  Side
88k     BC      66.11           18-Aug-09   S
74894   BED     CVBFGR0058      18-Aug-09   P
74897   BED     GHGHTGH0183     19-Aug-09   P
1391    BED     89.00           18-Aug-09   P
74890   BED     74.00           18-Aug-09   P
74895   BED     VVBRTG0041      19-Aug-09   P
74896   BED     FGFGFHC01       19-Aug-09   P
74891   BED     ABCD0036        18-Aug-09   S
``````
1. If ID from the source matches with the target then need to check whether the corresponding columns are same.

2. If Records under the name is a number then the number needs to be converted to an integer and then compare.

I used the below formula

``````=IF(ISNUMBER(MATCH(\$A2,\$A\$15:\$A\$24,0)),ISNUMBER(MATCH(1,INDEX((\$A\$15:\$A\$24=\$A2)*(IF(ISNUMBER(B2),INT(B\$15:B\$24)=INT(B2),B\$15:B\$24=B2)),0),0)),"")
``````

It is not working. How can I make it work?

-
Might be that your formula is not even attempting to match Name column, but that is difficult to tell when you give no indication of what is in which of the cell references you refer to! –  pnuts Oct 11 '12 at 12:36
`ISNUMBER(MATCH(1,INDEX((\$A\$15:\$A\$24=\$A2)*` do you really want to multiply a boolean with something else? –  Jook Oct 11 '12 at 12:47