Have you accounted for the situation where any one or more of the items are not selected?
Unselected check boxes have a value of "Off" and drop boxes for a blank or space value is a space.
1 person found this helpful
Hmmm??? I think the simple answer to that is no! The drop box is a required field and can only select Yes or No. I am not sure what to do about the check boxes being off - doesn't this mean they just won't add if they are not checked?
Because of the fact that you want to add a constant to a number of values if a given condition is meet then you will need to use a custom calculation script.
// get the value of the fields
var cMember = Number(this.getField("Member").value);
var nDay1 = this.getField("Day1").value;
var nDay2 = this.getField("Day2").value;
var nDinner = this.getField("Dinner").value;
// define a varaiable for the sum
var sum = 0;
// day 1 plus adjustement
if (nDay1 != "Off") sum += Number(nDay1) + cMember;
// day 2 plus adjustement
if ( Day2 != "Off") sum += Number(nDay2) + cMember;
// dinner plus adjustement
if (nDinner != "Off") sum += Number(nDinner) + cMember;
event.value = sum;
Excel is only easy if you accept Microsoft's view of calculations.
Thanks so much. I would never have got that to work without your help. May you be forever blessed with health, wealth and happiness.