Try this formula in E2:

=INDEX('Pig Inventory'!C$2:C$8,MATCH(1,INDEX(('Pig Inventory'!$A$2:$A$8=$B2)*('Pig Inventory'!$B$2:$B$8=$D2),0),0))

adjust ranges to suit your database, and copy down and across.