diff --git a/src/java/org/apache/poi/ss/formula/functions/DGet.java b/src/java/org/apache/poi/ss/formula/functions/DGet.java index 0bf9cc262..5cdc29251 100644 --- a/src/java/org/apache/poi/ss/formula/functions/DGet.java +++ b/src/java/org/apache/poi/ss/formula/functions/DGet.java @@ -36,10 +36,18 @@ public final class DGet implements IDStarAlgorithm { { result = eval; } - else // There was a previous match, since there is only exactly one allowed, bail out. + else // There was a previous match. Only one non-blank result is allowed. #NUM! on multiple values. { - result = ErrorEval.NUM_ERROR; - return false; + if(result instanceof BlankEval) { + result = eval; + } + else { + // We have a previous filled result. + if(!(eval instanceof BlankEval)) { + result = ErrorEval.NUM_ERROR; + return false; + } + } } return true; diff --git a/test-data/spreadsheet/DGet.xls b/test-data/spreadsheet/DGet.xls index 729e974e4..49514d20f 100644 Binary files a/test-data/spreadsheet/DGet.xls and b/test-data/spreadsheet/DGet.xls differ