|I believe that this is why SUMPRODUCT was invented! ;-)|
If you are running 2007 or above, I believe you can use SUMIFS
=SUMIFS(G5:G107, C5:C107, "=salary", F5:F107, "=v") [Untested]
Note the location of the double quotes and the location of the range you are summing. They are in different places for the 2 functions.