I started working with PHPExcel to read a file.
In my first steps, I would get a portion of the file because there is another that is not of my usefulness. I saw that the rangeToArray function was useful for this.
Just as a test, I tried to obtain from the start in row A12 to the end at Y25.
$sheetData = $objPHPExcel->getActiveSheet()->rangeToArray('A12:Y25');
This returns something like this:
array (size=14)
0 =>
array (size=25)
0 => float 258500
1 => string '#REF!' (length=5)
2 => string 'Nº equivocado' (length=14)
3 => string 'Nº equivocado' (length=14)
4 => boolean false
5 => boolean false
6 => boolean false
7 => boolean false
8 => boolean false
9 => boolean false
10 => null
11 => boolean false
12 => string '#DIV/0!' (length=7)
13 => string '166,056' (length=7)
14 => float 0
15 => string '11,070' (length=6)
16 => string '1,510' (length=5)
17 => string '12,580' (length=6)
18 => string 'Transferencia' (length=13)
19 => string 'Cheque' (length=6)
20 => string '1/1/2016' (length=8)
21 => string '1/31/2016' (length=9)
22 => null
23 => null
24 => string 'EL COSTO ANUAL ES 10% SUPERIOR AL MENSUAL X 12, DEBIDO AL 10% DE COMISION DE FASCIOLI' (length=85)
But the fact is that some values in the array does not match the values that have some cells.
The row is selected in image capture, it is what I'm trying to get to the rangeToArray function.
As I saw the values returned by the array, is not exactly the string that is the cell in excel, I decided to try to get that particular cell.
$sheetData = $objPHPExcel->getActiveSheet()->getCell('E12');
And I could see that the contents of the cell is stored in a variable call "calculatedValue".
object(PHPExcel_Cell)[3121]
private 'value' => string '=IF($A12=$B12,VLOOKUP($A12,#REF!,2))' (length=36)
private 'calculatedValue' => string 'PRINA EDIFICIO ' (length=30)
private 'dataType' => string 'f' (length=1)
private 'parent' =>
Then I saw that the value of the cell with rangeToArray function returns "boolean false" with the getCell function, returns as private 'calculatedValue' => string 'PRINA EDIFICIO' (length = 30)
I could also see that these cells are filled with the values collected from another excel.
=SI($A12=$B12;CONSULTAV($A12;'C:\wamp\www\PHPExcel\Documentation\Examples\Reader\sampleData\[BASE_RETENIDOS.xls]BASE DE DATOS'!$B$5:$I$729;2))
That's why my question is if I can get the values in string format if obtained without relying on other excel.
Thanks
]1