Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Issue with product function #367

Closed
Closed
@Nichilus

Description

Hello,

I have issues with the excel PRODUCT function. Attached at the bottom is a simple excel file. The PROD X rows execute the excel PRODUCT function over three preceding rows - in column B the function is PRODUCT(X:Z), in column C it is PRODUCT(X;Y;Z) and in column D it is multiplication "X * Y * Z"

Except for PROD 8, every other PROD X result should equal 0, as some cells in the range contain zero. However when running the excel via EPPlus, the results vary.

Results of the PRODUCT(X:Z) in column "B" seem to always take the value from the cell at the end of the range and multiply it by values of the other cells but only if those cell values are non-zero. E.g. PROD 4 (cell B16) equals 143 when run in EPPlus even though the cells in range have values 0, 11 and 13.

Results of the PRODUCT(X;Y;Z) in column "C" are identitcal to those in column "B", except for PROD 6 (cell C24) which for some reason equals zero (cell B24 equals 13).

Finally, when not using PRODUCT, but multiplication (column "D"), the results are correct (PROD 1-7 are 0, PROD 8 is 1).

I used the following code and debug mode to see the content of the cells:
using (ExcelPackage excel = new ExcelPackage(new FileInfo(excelFilePath))) { excel.Workbook.Calculate(); var cells = excel.Workbook.Worksheets["Sheet1"].Cells.Value; }

I also extracted results using the code below, but the extracted values are identitcal to those I see in debug mode.
excel.Workbook.Worksheets["Sheet1"].Cells[row, col].Value.ToString()

This seems like a bug but please let me know if I am doing something wrong.

I am using EPPlus version 4.5.2.1.
The project is a .NET 4.6.1 application.

Thanks

Attachments
ProductFunctionTest.xlsx

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions