Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Fix invalid NA return in VLOOKUP #423

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions Classes/PHPExcel/Calculation/LookupRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,7 @@ public static function VLOOKUP($lookup_value, $lookup_array, $index_number, $not
return PHPExcel_Calculation_Functions::NA();
} else {
// otherwise return the appropriate value
$result = $lookup_array[$rowNumber][$returnColumn];
if ((is_numeric($lookup_value) && is_numeric($result)) ||
(!is_numeric($lookup_value) && !is_numeric($result))) {
return $result;
}
return $lookup_array[$rowNumber][$returnColumn];
}
}

Expand Down Expand Up @@ -802,8 +798,7 @@ public static function HLOOKUP($lookup_value, $lookup_array, $index_number, $not
return PHPExcel_Calculation_Functions::NA();
} else {
// otherwise return the appropriate value
$result = $lookup_array[$returnColumn][$rowNumber];
return $result;
return $lookup_array[$returnColumn][$rowNumber];
}
}

Expand Down