2 Replies Latest reply on Dec 29, 2011 1:37 PM by CarrieB.

# Sum calculation based on results of another field

### Title

Sum calculation based on results of another field

### Post

I have a calculation field that looks like this:

Sum (Field1; Field2; Field3; Field4; Field5; Field6)

I have 6 more fields that follow these ones that are a yes/no result. So, for instance, Field1 is a number and FieldA is a yes/no result, Field2 is a number and FieldB is a yes/no result, etc., etc.

I would like the Sum calculation to only include the field if the related field has a yes result.

Can anyone help me out?

Carrie

• ###### 1. Re: Sum calculation based on results of another field

This can be done, but it appears you have a very cumbersome design for your table. It would appear a better structure to have a table of related records with one yes/no field and one number field in each related record.

To solve the immediate problem,

add a series of calculation fields written with this pattern:

If ( FieldA = "yes" ; field1 )

This calculation will return the number in field1 if FieldA stores the text "yes" and will be empty if it does not.

Then sum these calculation fields instead of the original number fields.

• ###### 2. Re: Sum calculation based on results of another field

That will work. Thank you!!