Skip to content

if returns empty string instead 0 #476

Closed

Description

@doczoidberg

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

Activity

  1. added
    Bug
    on Jul 21, 2020
  2. self-assigned this
    on Jul 21, 2020
  3. krzysztofspilka commented on Jul 29, 2020

    @krzysztofspilka
    Member

    @izulin do we have any update on this?

  4. bardek8 commented on Jul 31, 2020

    @bardek8
    Contributor

    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

  5. doczoidberg commented on Aug 4, 2020

    @doczoidberg
    Author

    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?

  6. AMBudnik commented on Aug 7, 2020

    @AMBudnik
    Contributor

    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.

  7. added
    Feature
    on Aug 7, 2020
  8. doczoidberg commented on Aug 10, 2020

    @doczoidberg
    Author

    @AMBudnik can you give a rough time estimation?

  9. AMBudnik commented on Aug 10, 2020

    @AMBudnik
    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.

  10. doczoidberg commented on Aug 25, 2020

    @doczoidberg
    Author

    any news here?

  11. bardek8 commented on Aug 25, 2020

    @bardek8
    Contributor

    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.

  12. doczoidberg commented on Aug 27, 2020

    @doczoidberg
    Author

    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

  13. added
    Verified
    on Sep 11, 2020
  14. wojciechczerniak commented on Sep 11, 2020

    @wojciechczerniak
    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

Metadata

Metadata

Assignees

Labels

BugFeatureVerified

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions