ShowAll Questionssorted byDate Posted
Skeeter

# Formula to calculate average but not include null values

I'm trying to create a formula to calculate the average of 5 questions (1-5 values), but not include any null values.  I tried the following, but it doesn't seem to work.  If I null out all the answers and leave one with 4, it displays the average as 0.00.

Any help is greatly appreciated.
```(IF(ISNULL(Answer2__c),0,Answer2__c)+IF(ISNULL(Answer3__c),0,Answer3__c)+IF(ISNULL(Answer4__c),0,Answer4__c)+IF(ISNULL(Answer6__c),0,Answer6__c)+IF(ISNULL(Answer7__c),0,Answer7__c))
/

William Tran
In general, it looks fine to me.  be sure you are testing with answer 2,3,4,6,7.  Also make sure these an numbers not strings.  IF you enter a value for 1,5,, or higher than 7 you will get 0.00 as described.  Also I add an addition if the bottom is 0, give it 1 so you don't have dividing by 0 issues.

Thx

```(IF(ISNULL(Answer2__c),0,Answer2__c)+
/
IF(

Skeeter
I figured out what it was.  My formula was correct, I need to check the 'Treat blank fields as blanks'.
William Tran
Lilranger,