Hi,

I got an error message when I try to fix a problem I had.

Sometimes the MIN could be negative, which mess up the values MAX - MIN. I tried to add the IF to fix it, but somehow it did not work.

And the one I had is pasted below.

PHP Code:
 ActiveCell.FormulaR1C1 _
        
"=iferror(1/(MAX(RC[-" PWYears "]:RC[-5])-if(MIN(RC[-" PWYears "]:RC[-5])>0,MIN(RC[-" PWYears "]:RC[-5]),-MIN(RC[-" PWYears "]:RC[-5])))/AVERAGE(R4C2:R" IHeight "C" PWYears ")*10,100000)" 
Thanks,

Matt