The easiest way would be to add a helper column, like this:
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #FAFAFA"]Area[/TD]
[TD="bgcolor: #FAFAFA"]Primary Site[/TD]
[TD="bgcolor: #FAFAFA"]Secondary Site[/TD]
[TD="bgcolor: #FAFAFA"]Value[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]2[/TD]
[TD="bgcolor: #FAFAFA"]A[/TD]
[TD="bgcolor: #FAFAFA"]yes[/TD]
[TD="bgcolor: #FAFAFA"]no[/TD]
[TD="bgcolor: #FAFAFA, align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: center"]3[/TD]
[TD="bgcolor: #FAFAFA"]B[/TD]
[TD="bgcolor: #FAFAFA"]yes[/TD]
[TD="bgcolor: #FAFAFA"]no[/TD]
[TD="bgcolor: #FAFAFA, align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]4[/TD]
[TD="bgcolor: #FAFAFA"]A[/TD]
[TD="bgcolor: #FAFAFA"]no[/TD]
[TD="bgcolor: #FAFAFA"]yes[/TD]
[TD="bgcolor: #FAFAFA, align: right"]7[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]5[/TD]
[TD="bgcolor: #FAFAFA"]C[/TD]
[TD="bgcolor: #FAFAFA"]no[/TD]
[TD="bgcolor: #FAFAFA"]no[/TD]
[TD="bgcolor: #FAFAFA, align: right"]3[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
Sheet4
[TABLE="width: 85%"]
<tbody>[TR]
[TD]
Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]E2[/TH]
[TD="align: left"]=(
COUNTIF(B2:C2,"yes")>0)*(
COUNTIFS(A$1:A1,A2,B$1:B1,"yes")+COUNTIFS(A$1:A1,A2,C$1:C1,"yes")=0)[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]F2[/TH]
[TD="align: left"]=SUMPRODUCT(
D2:D5,E2:E5)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 85%"]
<tbody>[TR]
[TD]
Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]G2[/TH]
[TD="align: left"]{=SUM(
IF(ROW(A2:A5)-ROW(A2)+1=IF(IFERROR(MATCH(A2:A5&"yes",A2:A5&B2:B5,0),2^20)< IFERROR(MATCH(A2:A5&"yes",A2:A5&C2:C5,0),2^20),IFERROR(MATCH(A2:A5&"yes",A2:A5&B2:B5,0),2^20),IFERROR(MATCH(A2:A5&"yes",A2:A5&C2:C5,0),2^20)),D2:D5))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
The formula in E2 figures out if the area on that row is the first instance of the area with a "yes". Then the very simple formula in F2 gives you the sum.
It is possible to create a single-cell formula to get that sum, for example, look at the G2 array formula. It's pretty complicated, but maybe someone else can improve on it.