M
msnews.microsoft.com
There is a read-only field in my form whose value is calculated with the
following formula:
EstimatedCost = EquipmentSubtotal + ServiceSubtotal + MaterialsSubtotal
The 3 subtotals variables on the right hand side which is the meat of the
formula come from optional sections. When either subsection is not used,
the EstimatedCost field will display a NaN value because the expected value
is not defined.
I've tried something like:
EstimatedCost = na(EquipmentSubtotal) + na(ServiceSubtotal) +
na(MaterialsSubtotal)
since, supposedly the "na" function will return a zero if a value is not
present, but in this case the na function doesn't do what I wish it did.
Obviously I'm not doing something right. How can I write a formula that
basically does something like this:
if (EquipmentSubtotal is defined) {EstimatedCost = EstimatedCost +
EquipmentSubtotal };
if (ServiceSubtotal is defined) { EstimatedCost = EstimatedCost +
ServiceSubtotal };
if (MaterialsSubtotal is defined) { EstimatedCost = EstimatedCost +
MaterialsSubtotal }
Thanks,
Stav
following formula:
EstimatedCost = EquipmentSubtotal + ServiceSubtotal + MaterialsSubtotal
The 3 subtotals variables on the right hand side which is the meat of the
formula come from optional sections. When either subsection is not used,
the EstimatedCost field will display a NaN value because the expected value
is not defined.
I've tried something like:
EstimatedCost = na(EquipmentSubtotal) + na(ServiceSubtotal) +
na(MaterialsSubtotal)
since, supposedly the "na" function will return a zero if a value is not
present, but in this case the na function doesn't do what I wish it did.
Obviously I'm not doing something right. How can I write a formula that
basically does something like this:
if (EquipmentSubtotal is defined) {EstimatedCost = EstimatedCost +
EquipmentSubtotal };
if (ServiceSubtotal is defined) { EstimatedCost = EstimatedCost +
ServiceSubtotal };
if (MaterialsSubtotal is defined) { EstimatedCost = EstimatedCost +
MaterialsSubtotal }
Thanks,
Stav