The built-in Dsum function should work: =DSum("Nz([QuantitySum], 0)","YourTable","[Bonus] = " & False)