Skip empty cells when unfolding ranges - #35
Open
garak95 wants to merge 1 commit into
Open
Conversation
This allows statistical functions to work properly.
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes empty cells from ranges when expanding them. This allows mainly statistical functions to work as expected. Cells that do contain a 0 are preserved, of course. Matrices are also unaffected by this change because they would change shape.
I have not found any formula that would suffer from my changes, but maybe I lack imagination? If such case exist, it can be fixed by manually typing 0 in the empty cells, or by adding a setting to control my new behavior.
I've considered a few other options to achieve the behavior I was looking for:
a1::a7orFILTER(a1:a7)but ultimately modifying the regular syntax doesn't seem to have any downsides.Other notes:
sumwrapper was already mostly unnecessary since you added null as zero, but with this PR the wrapper is now entirely redundant and could be removed. I did not do it now because I wanted to keep this PR as small as possible.=median(a1:b7)will return an error. This is how it works in spreadsheets too. But if, you prefer, I can create a 3 lines wrapper to enhance some functions and allow them to return 0 when they receive an empty range (sum/median/mean/min/max might make sense).