From ded0f6dc13128deebb1caabaa87a5e3cee14ac16 Mon Sep 17 00:00:00 2001 From: Roman Syroeshko Date: Sun, 3 Nov 2013 21:24:10 -0800 Subject: [PATCH] https://github.com/PHPOffice/PHPExcel/issues/258 CHOOSE() returns "#VALUE!" if the 1st entry is chosen --- Classes/PHPExcel/Calculation/LookupRef.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Calculation/LookupRef.php b/Classes/PHPExcel/Calculation/LookupRef.php index 96c7da2..fc9fdba 100644 --- a/Classes/PHPExcel/Calculation/LookupRef.php +++ b/Classes/PHPExcel/Calculation/LookupRef.php @@ -462,7 +462,7 @@ class PHPExcel_Calculation_LookupRef { return PHPExcel_Calculation_Functions::VALUE(); } $chosenEntry = floor($chosenEntry); - if (($chosenEntry <= 0) || ($chosenEntry > $entryCount)) { + if (($chosenEntry < 0) || ($chosenEntry > $entryCount)) { return PHPExcel_Calculation_Functions::VALUE(); }