I have several tables in an InfoPath form that contain numbers. I have calculated value fields to determine the average of the numbers entered in each table. The problem is that it is calculating the average based on the total number of fields in the table and most of the time some of the fields do not have values. I tried this: (my:Field1 + my: Field2 + my: Field3 + my: Field4) div (count(my: Field1) + count(my: Field2) + count(my: Field3) + count(my: Field4)) but it is still counting the blank fields. Any suggestions? Thanks!