Averageif

Mar 9, 2012 at 3:59 PM

The averageif does not work

$objPHPExcel->getActiveSheet($nummes)->setCellValue($letra.$totalele, '=AVERAGEIF('.$letra.'3:'.$letra.$ele.',">0")');

Coordinator
Mar 9, 2012 at 5:36 PM

It did when I last tried it.....

Please provide at least a little more detail. e.g. what values are in your range $letra.'3:'.$letra.$ele? What result do you expect? What result do you get? How are you testing this? Have you enabled calculation logging to see what the function is actually doing? Are you trying to save using Excel5? (it isn't a valid Excel5 function)

Mar 9, 2012 at 9:01 PM

If it is not a function there validates of excel5, which I can use? I have a list of percentages but some of them have value 0 at the time what I want is that on having extracted the average one does not take those who have 0

Coordinator
Mar 9, 2012 at 11:35 PM

You can always try to simulate it using valid Excel5 functions:

{=AVERAGE(IF(A1:A10>0,A1:A10,FALSE))}