u donn require to write a seperate code is the value is null...s check the properties and give the value as 0 IF null..that is the straight approach..
if u could ctrl-c and ctrl-v it in the forum i can check the existing formula column...
the only reason that could happen is when the formula is not returning any value..that could be due to exception or could be due to missing RETURN statement in the approriate place..