0

I use PHPExcel to read an Excel-Spreadsheet file and its values. So far it works well. All values can be read, even the resulting value of a simple formula: =B3 However with a more complex formula, such as =VLOOKUP(B1,V3:W20,2,FALSE) PHPExcel returns #N/A, although in the Excel sheet there is definitely a real value.

Here is the relevant part of the code:

include_once('include/PHPExcel/IOFactory.php');
$inputFileType = PHPExcel_IOFactory::identify($strFileTemp);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load("$ppath/update");
$sheetData = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true);
$value = $sheetData[1]['A'];
echo "<br>value:".$value."<br>";

Do I not to provide some special value-command?

pnuts
  • 58,317
  • 11
  • 87
  • 139
d-nnis
  • 71
  • 8
  • It depends exactly how complex the formula is.... PHPExcel can handle some quite complex formulae, but it isn't perfect..... you can debug the calculation engine and see where it might be wrong using the built-in formula debugger, as explained in [this gist](https://gist.github.com/MarkBaker/5908357) – Mark Baker Aug 13 '15 at 14:17
  • Ah, thanks, I will check with those approaches! – d-nnis Aug 13 '15 at 14:35

0 Answers0