I am familiar with how to find duplicates between only 2 columns, but what about between 2 pairs of columns?

I am comparing an old report against a new one, which I have combined onto one sheet. In Column A there is an IP address, in Column B there is an error code, and the refreshed data in columns C and D, respectively. Some error codes may come up on a new IP address, so I can't simply look for duplicates of error codes, I have to see if the duplicate is coming up on the same machine.

Right now, I'm working with this formula between just two columns;
=IF(ISERROR(MATCH(B5,$D$5:$D$501,0)),"",B5)

Having a less-than-thorough understanding of excel formulas, is there some complex way I can find duplicates between these pairs?