#463 : Patch @domic-olga vlookup - incorrect value when not exact match
This commit is contained in:
parent
20d007abb1
commit
6faed3bd58
|
@ -720,9 +720,13 @@ class LookupRef
|
||||||
(!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]) && (strtolower($rowData[$firstColumn]) > strtolower($lookup_value)))) {
|
(!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]) && (strtolower($rowData[$firstColumn]) > strtolower($lookup_value)))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// remember the last key, but only if datatypes match
|
||||||
|
if ((is_numeric($lookup_value) && is_numeric($rowData[$firstColumn])) ||
|
||||||
|
(!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]))) {
|
||||||
$rowNumber = $rowKey;
|
$rowNumber = $rowKey;
|
||||||
$rowValue = $rowData[$firstColumn];
|
$rowValue = $rowData[$firstColumn];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($rowNumber !== false) {
|
if ($rowNumber !== false) {
|
||||||
if ((!$not_exact_match) && ($rowValue != $lookup_value)) {
|
if ((!$not_exact_match) && ($rowValue != $lookup_value)) {
|
||||||
|
|
Loading…
Reference in New Issue