Logic to rollupsum if checkbox is checked

I am trying to create a formula with Sugar logic that adds up fields ONLY if a checkbox is checked. I haven't been able to find what a checked versus an unchecked variable looks like in a formula. I tried "true" for checked and below "1" represents check. However, the formula below is still just adding up everything, regardless of the checkbox.

This is what I'm after: If the check box is checked, add the fields together. If the check box is not checked, do not include it in the sum.

  • $contacts_medb_medical_bills_1 is a custom module with a one to many relationship from Contacts
  • "lop_lien" is the check box field
  • "balance" is the amount that is being added to create the sum for the field

ifElse(equal(related($contacts_medb_medical_bills_1,"lop_lien"),"1"),rollupSum($contacts_medb_medical_bills_1,"balance"),ifElse(equal(related($contacts_medb_medical_bills_1,"lop_lien"),"0"),0,0))

Thanks for any insight!