T5750 / poi-repositories

:sunny: Read and Write Excel file using Java and Apache POI
https://poix.readthedocs.io
Apache License 2.0
323 stars 298 forks source link

`xlookup` doesn't register as a FuncVarPtg #6

Open meygerjos opened 2 years ago

meygerjos commented 2 years ago

For some reason the parser recognizes lookup but not xlookup, even though xlookup is supposed to be supported.

Code:

System.out.println("Parse \"LOOKUP(E76,$A$13:$A$41,$F$13:$F$41)\"");
for (Ptg ptg : FormulaParser.parse("LOOKUP(E76,$A$13:$A$41,$F$13:$F$41)", ewb, FormulaType.CELL, wb.getSheetIndex(sheet))) {
    System.out.println(ptg);
}
System.out.println("Parse \"XLOOKUP(E76,$A$13:$A$41,$F$13:$F$41)\"");
for (Ptg ptg : FormulaParser.parse("XLOOKUP(E76,$A$13:$A$41,$F$13:$F$41)", ewb, FormulaType.CELL, wb.getSheetIndex(sheet))) {
    System.out.println(ptg);
}

Output:

Parse "LOOKUP(E76,$A$13:$A$41,$F$13:$F$41)"
{   /* RefPtg */
      "row": 75 /* 0x0000004b */
    , "rowRelative": true
    , "column": 4
    , "colRelative": true
    , "formatReference": "E76"
}
{   /* AreaPtg */
      "firstRow": 12 /* 0x0000000c */
    , "firstRowRelative": false
    , "firstColumn": 0
    , "firstColRelative": false
    , "lastRow": 40 /* 0x00000028 */
    , "lastRowRelative": false
    , "lastColumn": 0
    , "lastColRelative": false
    , "formatReference": "$A$13:$A$41"
}
{   /* AreaPtg */
      "firstRow": 12 /* 0x0000000c */
    , "firstRowRelative": false
    , "firstColumn": 5
    , "firstColRelative": false
    , "lastRow": 40 /* 0x00000028 */
    , "lastRowRelative": false
    , "lastColumn": 5
    , "lastColRelative": false
    , "formatReference": "$F$13:$F$41"
}
{   /* FuncVarPtg */
      "functionIndex": 28 /* 0x001c */
    , "functionName": "LOOKUP"
    , "numberOfOperands": 3
    , "externalFunction": false
    , "defaultOperandClass": 32 /* 0x20 */
    , "cetab": false
}
Parse "XLOOKUP(E76,$A$13:$A$41,$F$13:$F$41)"
{   /* NameXPxg */
      "externalWorkbookNumber": -1 /* 0xffffffff */
    , "sheetName": null
    , "nameName": "XLOOKUP"
}
{   /* RefPtg */
      "row": 75 /* 0x0000004b */
    , "rowRelative": true
    , "column": 4
    , "colRelative": true
    , "formatReference": "E76"
}
{   /* AreaPtg */
      "firstRow": 12 /* 0x0000000c */
    , "firstRowRelative": false
    , "firstColumn": 0
    , "firstColRelative": false
    , "lastRow": 40 /* 0x00000028 */
    , "lastRowRelative": false
    , "lastColumn": 0
    , "lastColRelative": false
    , "formatReference": "$A$13:$A$41"
}
{   /* AreaPtg */
      "firstRow": 12 /* 0x0000000c */
    , "firstRowRelative": false
    , "firstColumn": 5
    , "firstColRelative": false
    , "lastRow": 40 /* 0x00000028 */
    , "lastRowRelative": false
    , "lastColumn": 5
    , "lastColRelative": false
    , "formatReference": "$F$13:$F$41"
}
{   /* FuncVarPtg */
      "functionIndex": 255 /* 0x00ff */
    , "functionName": "#external#"
    , "numberOfOperands": 4
    , "externalFunction": true
    , "defaultOperandClass": 32 /* 0x20 */
    , "cetab": false
}
meygerjos commented 2 years ago

Just put a bug report on Apache POI: https://bz.apache.org/bugzilla/show_bug.cgi?id=66283