Bug 64423

Summary: Formula evaluation containing a named range with relative address produces incorrect result
Product: POI Reporter: lrx <lrx>
Component: SS CommonAssignee: POI Developers List <dev>
Status: NEW ---    
Severity: major CC: lrx
Priority: P2    
Version: 4.1.2-FINAL   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: source code for generating described issue

Description lrx 2020-05-11 20:12:42 UTC
Created attachment 37226 [details]
source code for generating described issue

In Excel you can generate a name with relative addressing even by using A1 reference style

For example:

1) Select cell A1

2) Define a name CURRENT_ROW_COLUMN_A as =Sheet1!$A1

3) In column A insert some numbers

   | A 
---+----
 1 | 1
 2 | 2
 3 | 3
 4 | 4
 5 | 5

4) In B1 insert formula CURRENT_ROW_COLUMN_A+1000

   | A | B
---+---+---
 1 | 1 | =CURRENT_ROW_COLUMN_A+1000
 2 | 2 | 
 3 | 3 | 
 4 | 4 | 
 5 | 5 | 

5) Then double click B1 bottom right corner to auto expand and view the result:

   | A | B
---+---+---
 1 | 1 | 1001
 2 | 2 | 1002
 3 | 3 | 1003
 4 | 4 | 1004
 5 | 5 | 1005

Attached code generate a test workbook with additional columns showing incorrect evaluation behavior, relative address is always pointing @ row 1.

Column C is POI evaluation result:

   | A | B    | C (issue)
---+---+------+-----
 1 | 1 | 1001 | 1001
 2 | 2 | 1002 | 1001
 3 | 3 | 1003 | 1001
 4 | 4 | 1004 | 1001
 5 | 5 | 1005 | 1001