I concluded that getOldCalculatedValue() returns already calculated formula if a cell contains a formula, or value if a cell does not contain a formula. My assumption is confirmed by Mark Baker's post (althought this post is from year 2011):
$value = $objPHPExcel->setActiveSheetIndex(0)
->getCell('G'.$i)
->getValue();
Will return the actual formula if the cell contains a formula, or the
value if the cell contains a value.
$value = $objPHPExcel->setActiveSheetIndex(0)
->getCell('G'.$i)
->getCalculatedValue();
Will return the calculated value if the cell contains a formula, or the value
if the cell contains a value.
$value = $objPHPExcel->setActiveSheetIndex(0)
->getCell('G'.$i)
->getOldCalculatedValue();
Will return the previous result of a calculation if the cell contains a formula,
or the value if the cell contains a value.
I created xlsx (Excel 2007) with one cell A1. A1's content is string 'foo'. When I call
$reader = new PHPExcel_Reader_Excel2007();
$excel = $reader->load(Input::file("pricelist")->getRealPath());
$worksheet = $excel->setActiveSheetIndex(0);
var_dump($worksheet->getCell('A1')->getOldCalculatedValue());
it prints NULL. If I change function to getCalculatedValue() or getValue() it works ok. I'm using PHPExcel 1.8.0.