If you're looking for only the value for a specific company shipped to and from CA, try this array formula, entered with ctrl+shift+enter:
=INDEX($C$2:$G$11,MATCH(1,($A$2:$A$11=$A2)*($B$2:$B$11="CA"),0),MATCH("CA",$C$1:$G$1,0))
This will retrieve a single value at the intersection of the CA row and CA column, for Test Company 1.
If you're looking to sum up every value that shipped from CA plus every value that was shipped to CA, try this formula:
=SUMPRODUCT(($A$2:$A$11=$A2)*($B$2:$B$11="CA")*$C$2:$G$11)+SUMPRODUCT(($A$2:$A$11=$A2)*($C$1:$G$1="CA")*($B$2:$B$11<>"CA")*$C$2:$G$11)
This will add up all the values in the CA row for Test Company 1, plus all the values in the CA column for Test Company 1. The second formula will not include the cell where the CA row and CA column intersect.
Does either of those give you the result you're looking for?
Bookmarks