relaxinjim
Programmer
I am using Crystal 9.
I am interested in calculating the average of multiple fields 'horizontally' in a report. I set up a formula adding the fields and then dividing by the number of fields:
(fld1 + fld2 + fld3 + fld4)/4
(3 + 2 + 4 + 3)/4 = 3
This returned me the correct answer for most situations.
However, my problem relates to a few instances were a fields have the value of "0". In my report a field with the value of "0" can not count in the average. For example:
(fld1 + fld2 + fld3 + fld4)/4
(3 + 2 + 0 + 3)/4 = 2
This formula does not return the answer I need. I need the formula to "adjust" to potential "0" values to read like this:
(fld1 + fld2 + fld3 + fld4)/3
(3 + 2 + 0 + 3)/3 = 2.66
Any suggestions are appreciated.
Thanks
I am interested in calculating the average of multiple fields 'horizontally' in a report. I set up a formula adding the fields and then dividing by the number of fields:
(fld1 + fld2 + fld3 + fld4)/4
(3 + 2 + 4 + 3)/4 = 3
This returned me the correct answer for most situations.
However, my problem relates to a few instances were a fields have the value of "0". In my report a field with the value of "0" can not count in the average. For example:
(fld1 + fld2 + fld3 + fld4)/4
(3 + 2 + 0 + 3)/4 = 2
This formula does not return the answer I need. I need the formula to "adjust" to potential "0" values to read like this:
(fld1 + fld2 + fld3 + fld4)/3
(3 + 2 + 0 + 3)/3 = 2.66
Any suggestions are appreciated.
Thanks