Excel - compare two columns, if match subtract values of other two columns from matching rows
<p>I'm trying to compare two columns for identical values in cells. Not all of them match. For those that match, i.e. cell in col B1 matches a cell in col D2, I would like to subtract A1-C2. A and B come from one pool of data, and C and D from another. They should be compared, and values subtracted if the strings match.</p>

<p><a href="https://i.stack.imgur.com/dR681.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dR681.png" alt="Image of columns"></a></p>

<p>Thank you</p>