Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell.Value reading incorrectly on array formula #2337

Open
3 of 7 tasks
paulyp1 opened this issue May 1, 2024 · 0 comments
Open
3 of 7 tasks

Cell.Value reading incorrectly on array formula #2337

paulyp1 opened this issue May 1, 2024 · 0 comments

Comments

@paulyp1
Copy link

paulyp1 commented May 1, 2024

Read and complete the full issue template

Do not randomly delete sections. They are here for a reason.

Do you want to request a feature or report a bug?

  • Bug
  • Feature
  • Question

Did you test against the latest CI build?

  • Yes
  • No
  • Sorry I don't really know how to do this

If you answered No, please test with the latest development build first.

Version of ClosedXML

0.102.2

What is the current behavior?

Reading the Cell.Value returns incorrect value from relatively simple array formula. This part is a little hard to describe without the cell values. I have two cells next to one another.

The first with the formula =PRODUCT((C5:C7)+1)-1
The second with the formula =PRODUCT((D5:D7)+1)-1

When reading the Cell.Value of the first cell, it evaluates the formula fine and returns the value displayed in the cell. When reading the second, for some reason it only returns the value of cell D5, not the value displayed in the cell.

What is the expected behavior or new feature?

Cell.Value correctly evaluates the formula and returns the value displayed in the cell in the spreadsheet.

Is this a regression from the previous version?

Regressions get higher priority. Test against the latest build of the previous minor version. For example, if you experience a problem on v0.95.3, check whether it the problem occurred in v0.94.2 too.

Reproducibility

This is an important section. Read it carefully. Failure to do so will cause a 'RTFM' comment.

Without a code sample, it is unlikely that your issue will get attention. Don't be lazy. Do the effort and assist the developers to reproduce your problem. Code samples should be minimal complete and verifiable. Sample spreadsheets should be attached whenever applicable. Remove sensitive information.

This is in a .Net Blazor application.

Code to reproduce problem:

@using ClosedXML.Excel;

public async Task ButtonClicked()
{
    await bareMinimum();
}

public async Task bareMinimum() {
    var path = @$"{YOUR_PATH_HERE}\ClosedXMLTest.xlsx";
    XLWorkbook wb = new XLWorkbook(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
    var ws = wb.Worksheet("Test");

    var a = ws.Cell(5, 4).Value;
    var b = ws.Cell(7, 5).Value;
    var c = ws.Cell(7, 6).Value;
}

var a and b return the correct values, but var c does not.

  • I attached a sample spreadsheet. (You can drag files on to this issue)
    ClosedXMLTest.xlsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant