-1

I have to edit a worksheet, which uses VLOOKUP. In my template, VLOOKUP has to search for a value using an index, which is formatted like this:

When I now edit the template in PhpSpreadsheet and change a value or an index, which forces to recalculate VLOOKUP, PhpSpreadsheets CalculationEngine seems to ignore the specified format and delivers the wrong value(1 is 1 for PhpSpreadsheet, no matter the format). This is resolved, once you edit the spreadsheet again with Excel, however, I require the value of VLOOKUP BEFORE I can edit it again with Excel.

Ru Chern Chong
  • 3,692
  • 13
  • 33
  • 43
DevLj
  • 1
  • 3

1 Answers1

0

After some further research I found out, that PhpSpreadsheets VLOOKUP function, wich can be found under PhpSpreadsheet/Calculation/LookupRef.php, stringifies all values. With the use of is_nummeric, which also returns true on stringified numbers, the function ignored datatypes.

Further explanation can be found under the issue I created:
LookupRef function VLOOKUP is not datatype specific

I corrected the bug in this Pull request:
distinguish datatypes in VLOOKUP

DevLj
  • 1
  • 3