This repository was archived by the owner on Jan 2, 2019. It is now read-only.
This repository was archived by the owner on Jan 2, 2019. It is now read-only.
Problem with VLOOKUP #385
Open
Description
I have code:
$workSheet->setCellValue('A1', 'M20');
$workSheet->setCellValue('A2', 'M24');
$workSheet->setCellValue('A3', 'M30');
$workSheet->setCellValue('A4', 'M36');
$workSheet->setCellValue('B1', 'a1');
$workSheet->setCellValue('B2', 'b1');
$workSheet->setCellValue('B3', 'c1');
$workSheet->setCellValue('B4', 'd1');
$workSheet->setCellValue('C1', 'a2');
$workSheet->setCellValue('C2', 'b2');
$workSheet->setCellValue('C3', 'c2');
$workSheet->setCellValue('C4', 'd2');
$workSheet->setCellValue('G6', '=VLOOKUP("M20",A1:C4,3)');
echo $workSheet->getCell('G6')->getCalculatedValue();
So it return a2 ==> TRUE
But when I change code:
$workSheet->setCellValue('A1', 'M20');
$workSheet->setCellValue('A2', 'M24');
$workSheet->setCellValue('A3', 'M30');
$workSheet->setCellValue('A4', 'M36');
$workSheet->setCellValue('B1', '230');
$workSheet->setCellValue('B2', '231');
$workSheet->setCellValue('B3', '232');
$workSheet->setCellValue('B4', '233');
$workSheet->setCellValue('C1', '200');
$workSheet->setCellValue('C2', '300');
$workSheet->setCellValue('C3', '400');
$workSheet->setCellValue('C4', '500');
$workSheet->setCellValue('G6', '=VLOOKUP("M20",A1:C4,3)');
echo $workSheet->getCell('G6')->getCalculatedValue();
I get #N/A instead 200. VLOOKUP return TRUE value if table_array is string? Help me