You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2010/11/30 15:46:37 UTC

DO NOT REPLY [Bug 50384] New: Some formulas/macros are giving #VALUE! error on Excel file(.XLS).

https://issues.apache.org/bugzilla/show_bug.cgi?id=50384

           Summary: Some formulas/macros are giving #VALUE! error on Excel
                    file(.XLS).
           Product: POI
           Version: 3.7
          Platform: PC
            Status: NEW
          Severity: critical
          Priority: P1
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: contact.aniket@gmail.com
                CC: contact.aniket@gmail.com


Code : 
cell.setCellFormula(formulaValue);
cell.setCellType(Cell.CELL_TYPE_FORMULA);

formualValues not working :
=+(SUBTOTAL(109,(INDIRECT(ADDRESS(ROW()+2,COLUMN())):INDIRECT(ADDRESS(ROW()+1000,COLUMN())))))

=IF(ISBLANK('Export Data'!B3),"",IF(LEFT('Export
Data'!B3,3)="%%%","",VALUE(TRIM(CLEAN('Export Data'!B3)))))

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 50384] Some formulas/macros are giving #VALUE! error on Excel file(.XLS).

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50384

--- Comment #3 from Aniket <co...@gmail.com> 2010-12-01 01:41:30 EST ---
Thanks all for your kind reply. :)
I tried to use FormulaEvaluator.evaluateInCell(Cell cell);
But it throws Not Implemented Yet exception.

Stack trace :
org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating cell
'Pivot Data'!B2
at
org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:321)
at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:288)
at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:221)
at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateFormulaCellValue(HSSFFormulaEvaluator.java:320)
at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateInCell(HSSFFormulaEvaluator.java:240)
at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateInCell(HSSFFormulaEvaluator.java:46)


But when I click on the cell on the excel file and press enter formula gets
evaluated. And for other simpler formulas I am not evaluating so excel does it
itself but in case of the above mentioned formulas it is giving #VALUE! error
on the excel file.

@Yegor : Our code is simple we do not do any manipulation with the formulas. We
save the formulas and it's coordinate and later just populate them on the excel
sheet :

 for (ExcelCoordinate formulaCoordinate : formulaCoordinates) {
      try {
        Sheet sheet = workbook.getSheetAt(formulaCoordinate.getSheet());
        if(sheet == null) {
          continue;
        }
        if(sheet.getSheetName().equals("Pivot Data") && !isCloned) {
          workbook.cloneSheet(formulaCoordinate.getSheet());
          isCloned = true;
        }
        Row row = sheet.getRow(formulaCoordinate.getRow());
        if(row == null) {
          continue;
        }
        Cell cell = ExportUtil.getCell(row, formulaCoordinate.getColumn());
        if(cell == null) {
          continue;
        }
        cell.setCellFormula(formulaCoordinate.getName());
        cell.setCellType(Cell.CELL_TYPE_FORMULA);
        //Cell evalutedCell = evaluator.evaluateInCell(cell);            
      }

Also if possible help me out with how can I stop this #VALUE! error and let
Excel do it's calcualtion.

Please Help!!!

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 50384] Some formulas/macros are giving #VALUE! error on Excel file(.XLS).

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50384

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #7 from Yegor Kozlov <ye...@dinom.ru> 2011-01-19 07:32:08 EST ---
Support for CLEAN and ADDRESS was committed in r1060788

Yegor

*** This bug has been marked as a duplicate of bug 50607 ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 50384] Some formulas/macros are giving #VALUE! error on Excel file(.XLS).

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50384

--- Comment #5 from Nick Burch <ni...@alfresco.com> 2010-12-02 06:47:32 EST ---
Are you able to create a simple test for this? Ideally this would be a
standalone unit test that creates a sheet, populates it with the formula, tries
and fails to evaluate the formula. Failing that, an excel file with only a few
cells populated, one of which holds the formula that you can't get evaluated?

Evaluation ought to work for most standard formula expressions, if there's a
bug then we'll need more details to identify why + fix.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: DO NOT REPLY [Bug 50384] Some formulas/macros are giving #VALUE! error on Excel file(.XLS).

Posted by Mark Beardsley <ma...@tiscali.co.uk>.
To resolve this issue I think that you will need to do as Yegor requested and
attach the template/file you are processing - if any - and the complete code
that you are using. Without these, it is impossible to determine if there
are any inetractions that cound be affecting the way POI is working.

Yours

Mark B
-- 
View this message in context: http://apache-poi.1045710.n5.nabble.com/DO-NOT-REPLY-Bug-50384-New-Some-formulas-macros-are-giving-VALUE-error-on-Excel-file-XLS-tp3286170p3289059.html
Sent from the POI - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 50384] Some formulas/macros are giving #VALUE! error on Excel file(.XLS).

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50384

--- Comment #4 from Aniket <co...@gmail.com> 2010-12-02 01:23:54 EST ---
Really Sorry!!!For being so impatient. Can someone just confirm that if it is a
bug then in which release this will be resolved. Also it will be great help if
there can be some workaround for now?
-- 
Thanks,
Aniket

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 50384] Some formulas/macros are giving #VALUE! error on Excel file(.XLS).

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50384

Aniket <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #6 from Aniket <co...@gmail.com> 2011-01-19 00:35:09 EST ---
I have introduced two new excel function that were not implemented yet in POI.
The functions are CLEAN and ADDRESS. I have submitted a Zip file that contains
all the new files as well as the changed files. Kindly do the review so that I
can check-in the files.

Thanks,
Aniket

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 50384] Some formulas/macros are giving #VALUE! error on Excel file(.XLS).

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50384

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
         OS/Version|                            |All

--- Comment #1 from Nick Burch <ni...@alfresco.com> 2010-11-30 09:54:58 EST ---
Are you remembering to re-calculate the formula values after changing the
formula?
http://poi.apache.org/spreadsheet/eval.html

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 50384] Some formulas/macros are giving #VALUE! error on Excel file(.XLS).

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50384

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal

--- Comment #2 from Yegor Kozlov <ye...@dinom.ru> 2010-11-30 10:32:26 EST ---
Please post the full code to reproduce the problem, ideally a junit test case.
If your code requires a template then attach it too. 

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org