How can insert formula in excel sheet using phpexcel

前端 未结 2 505
盖世英雄少女心
盖世英雄少女心 2020-12-15 04:23

I have checked many sites for solution of my problem but not found proper solution. I want to insert formula which will calculate the total of marks obtained by students. Ma

2条回答
  •  半阙折子戏
    2020-12-15 04:58

    @Mark Baker Thank you for show the way I tried and done like this -

    $calculatRow='';
        for($ctr=0;$ctr < count($marksColumnArr);$ctr++)
        {
        $calculatRow.='(($'.$marksColumnArr[$ctr].'##/$'.$maXmarksColumnArr[$ctr].'$##)*'.$divisionVal[$ctr].')+';      
    }
    $calculateArrbyRow=substr($calculatRow,0,-1);    
    // Replicate formula by row
    
     for($j=5;$jgetActiveSheet()->setCellValue($cell.$j, '='.$formula);
     }    
    $coumnStart=($coumnStart-1)+13; $subjectCtr++;
    }
    

提交回复
热议问题