Custom calculations with conditions on form