diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java index d23375fda5..a9062ff7bf 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java @@ -410,7 +410,9 @@ public final class XSSFCell extends CellBase { /* In an excel generated array formula, the formula property might be set, but the string is empty in related cells */ if (f == null || f.getStringValue().isEmpty()) { XSSFCell cell = getSheet().getFirstCellInArrayFormula(this); - return cell.getCellFormula(fpb); + if (cell != this) { + return cell.getCellFormula(fpb); + } } } if (f == null) {