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

Errors in interim calculations lead to wrong results #115

Open
snibbo opened this issue Feb 15, 2024 · 1 comment
Open

Errors in interim calculations lead to wrong results #115

snibbo opened this issue Feb 15, 2024 · 1 comment

Comments

@snibbo
Copy link

snibbo commented Feb 15, 2024

Hi,

I found an error in your calculation logic.

Please find attached file for an easy example:

  • Result 1 = Value 1 / Value 2
  • Result 2 = Result 1 * Value 3

So, when value 2 = 0, there is no result for "Result 1". In your code you also identify that error (t: 'e').
But then, you use an error code for translation, which is "0x07" in this case, which is evaluated as 7 for the further calculation. With that, Result 2 will be equal 7 * "Value 3", but should be an error instead.

It would be very helpful if the error type (t: 'e') is propagated to all calculations that are based on the error. Is that something you would consider?

function myMain() {
  let workbook = XLSX.readFile('WrongCalculation.xlsx');
  workbook.Sheets["Tabelle1"]["B3"].v = 0;
  // Recalc the workbook
  XLSX_CALC(workbook, { continue_after_error: true, log_error: true });
  console.log(workbook.Sheets["Tabelle1"]["B9"]);
}
myMain();

WrongCalculation.xlsx

Thank you very much!

@fabiooshiro
Copy link
Owner

I'm afraid as you can see that I don't have time to do this right now.

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

2 participants