在我的 excel 文件中,我有B1=IF(A1>0,"Greater than Zero",IF(A1<0,"Less than Zero","Equal Zero"))
. 更改值后,我尝试通过检索B1
信息。getCalculatedValue
A1
我这样做了多次,但是两个回声都返回“小于零”我不明白为什么第二个回声不返回“等于零?”
/** Change A1 Value **/
$objPHPExcel->getActiveSheet()->setCellValue('A1','=-1');
/** Calculate and State B1 Value **/
echo $objPHPExcel->getActiveSheet()->getCell('B1')->getCalculatedValue();
/** Change A1 Value AGAIN **/
$objPHPExcel->getActiveSheet()->setCellValue('A1','=0');
/** Calculate and State B1 Value **/
echo $objPHPExcel->getActiveSheet()->getCell('B1')->getCalculatedValue();