I need to average only columns where there is a number that is not equal to zero. I tried the following IF c THEN t ELSEIF c2 THEN t2 ELSE f ENDIF formula, but I am getting an error “Malformed function form” – what am I doing wrong here? This is the formula that is not working:
If [Q4 PY] = 0 THEN Average ([Q1], [Q2], [Q3], [Q4]) ELSEIF [Q4 PY] = 0 AND [Q1]=0 THEN Average ([Q2], [Q3], [Q4]) ELSEIF [Q4 PY] = 0 AND [Q1]=0 AND [Q2]=0 THEN Average ([Q3], [Q4]) ELSEIF [Q4 PY] = 0 AND [Q1]=0 AND [Q2]=0 AND [Q3]=0 THEN [Q4] ELSE Average ([Q4 PY],[Q1], [Q2], [Q3], [Q4]) ENDIF