The SUMPRODUCT function can do what you want.

Consider the expression (K1="R")+(I1="R"). This can evaluate to 0, 1, or 2. If we add 1 to this and then perform integer division by 2, the result will always be 0 or 1. 0 if neither cell contain s an R and if either cell or both contains an R.

The desired formula is

```
=SUMPRODUCT(INT(((K3:K373="R")+(I3:I373="R")+1)/2)*(G3:G373>0)*G3:G373)
```

Add the values only if there is at least one R and the value is positive.