Hi,

Why not use a helper column
Formula: copy to clipboard
=IF(A2="a",B2/C2,0)

and sum that?