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

if returns empty string instead 0 #476

Closed
doczoidberg opened this issue Jul 21, 2020 · 11 comments
Closed

if returns empty string instead 0 #476

doczoidberg opened this issue Jul 21, 2020 · 11 comments
Assignees
Labels
Bug Something isn't working Feature Something we can add later on without introducing a breaking change Verified Verified by Handsoncode

Comments

@doczoidberg
Copy link

doczoidberg commented Jul 21, 2020

following formula should result to 0 but results in an empty string

88040737-a0db5000-cb49-11ea-8437-83592b2fc4ca

this is important because e.g. the formula can be encapsulated by another one e.g. VLOOKUP or in another IF statement

@doczoidberg doczoidberg added the Bug Something isn't working label Jul 21, 2020
@izulin izulin self-assigned this Jul 21, 2020
@krzysztofspilka
Copy link
Member

@izulin do we have any update on this?

@bardek8
Copy link
Collaborator

bardek8 commented Jul 31, 2020

We started discussing this offline. Actually this case is quite complicated as this is the place of inconsistency between Excel, Google Sheets and LibreOffice Calc.
With the current implementation of HyperFormula we cannot behave as in Excel - this will require storing auxiliary data with each cell value and processing it appropriately. Currently we behave as in Google Sheets.

See the difference between Google Sheets:
gs

and Excel:
excel

@doczoidberg
Copy link
Author

doczoidberg commented Aug 4, 2020

An adaption of the if function for excel should be enough? If undefined==0 results to true and returns "0" if a cell reference is blank for excel tables all cases should be right? No need for auxilary data? Only a global setting for the calculation type and an adapted if function which handles the different calcultation types.

Your plans are not to support Excel soon?

@AMBudnik
Copy link
Contributor

AMBudnik commented Aug 7, 2020

Thank you for doing the investigation @bardek8. I've spoken with @krzysztofspilka and we both agree that we should consider switching to Excel's approach but as it is not an easy process we should mark this topic as a feature request and get back to it after doing the full investigation.

@doczoidberg we'll update you on every change to this topic.

@AMBudnik AMBudnik added the Feature Something we can add later on without introducing a breaking change label Aug 7, 2020
@doczoidberg
Copy link
Author

@AMBudnik can you give a rough time estimation?

@AMBudnik
Copy link
Contributor

@doczoidberg some of our crucial team members are ooo, we cannot start the process without them. As soon as they meet and agree on the next step towards the goal this topic will get updated accordingly.

@doczoidberg
Copy link
Author

any news here?

@bardek8
Copy link
Collaborator

bardek8 commented Aug 25, 2020

Sorry for the late reply. Unfortunately, currently we cannot provide any precise time estimations.
This is an involved issue that requires deep understanding of the Excel's behavior, which is very different from GoogleSheets and LibreOffice. We envisage that this will be a big change in HF, so we decided to address it in the later future, after we finish the project of adding new functions to HF.

@doczoidberg
Copy link
Author

doczoidberg commented Aug 27, 2020

I think you are overcomplating things here. Plese rethink about my comment:

If undefined==0 results to true and returns "0" if a cell reference is blank for excel tables all cases should be right? No need for auxilary data? Only a global setting for the calculation type and an adapted if function which handles the different calcultation types.

Can you give me hints where I have to edit the code? I can make a PR then

See also #488

@izulin
Copy link
Collaborator

izulin commented Aug 28, 2020

@izulin izulin mentioned this issue Aug 31, 2020
7 tasks
@wojciechczerniak wojciechczerniak added this to the September 2020 milestone Sep 11, 2020
@wojciechczerniak wojciechczerniak added the Verified Verified by Handsoncode label Sep 11, 2020
@wojciechczerniak
Copy link
Contributor

Done in #500. Implemented as a Vendor Behaviour setting evaluateNullToZero.

hyperformula/src/Config.ts

Lines 201 to 209 in 4e092bd

/**
* Sets the compatibility mode for behaviour of null value.
* If set, formula evaluating to null evaluates to 0 instead.
*
* @default false
*
* @category Engine
*/
evaluateNullToZero: boolean,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Feature Something we can add later on without introducing a breaking change Verified Verified by Handsoncode
Projects
None yet
Development

No branches or pull requests

6 participants