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

Table formulas are broken! Simple subtraction no longer works #1551

Closed
stevencohn opened this issue Aug 17, 2024 · 0 comments
Closed

Table formulas are broken! Simple subtraction no longer works #1551

stevencohn opened this issue Aug 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working high-priority High Priority released Available in a released installer

Comments

@stevencohn
Copy link
Owner

stevencohn commented Aug 17, 2024

Problem to Solve

Oh! The shame!! Relative cell references breaks simple subtraction.

From a user:

Release 6.5.0 has introduced a bug into OneMore Formulas. It may be easily demonstrated as follows:
It appears that the minus operator is no longer supported when referencing cells.
This issue caused problems with a complex page template which I have been using for more than a year.
The problems disappear when I revert to OneMore v6.1.0 (I don't have the installer for 6.4.0)

To Reproduce

  1. Create a table with a single column and three rows
  2. Enter any numbers into cells A1 and A2
  3. In cell A3, attempt to enter the formula "A1-A2" - it will be flagged as "Status - Invalid"

Workaround

Add spaces before and after the minus sign. For example, change A1-A2 to A1 - A2

Proposed Solution

Relative cell references will be replaced by a new function, cell(), and two variables, tablerows and tablecols. While the next release will break the relative cell reference feature, the new functions will be much more powerful, allowing both column offset and row offset, as well as forward looking relative references. The full syntax of the cell function will be

  • cell(colOffset, rowOffset)

Offsets are always relative to the current cell, i.e., 0,0 refers to the current cell. Both positive and negative offsets are allowed.

Examples

To add a reverse-looking summary cell to the bottom of a table, something like sum(A1,cell(0,-1)) will total all cells in the column from the first row (A1), down to the row just prior to the formula cell.

To add a forward-looking summary cell to the top of a table in cell A1, something like sum(A2, cell(0, tablerows-1)) will total all cells in the column from the second row (A2), down to the cell in the last row of the table; note that rowOffset parameter still needs to be expressed as an offset from the current cell, hence tablerows-1.

@stevencohn stevencohn added bug Something isn't working unread I have seen it or had time to refine it yet and removed unread I have seen it or had time to refine it yet labels Aug 17, 2024
@stevencohn stevencohn self-assigned this Aug 17, 2024
@stevencohn stevencohn added developing Accepted and development is in progress high-priority High Priority labels Aug 17, 2024
stevencohn added a commit that referenced this issue Sep 21, 2024
stevencohn added a commit that referenced this issue Sep 22, 2024
* Add cell, tablecols, tablerows functions
#1551

* math function

* new calculator
#1551

* trasnlate error messages

* translations

* translations
@stevencohn stevencohn added next-release Addressed but not yet released and removed developing Accepted and development is in progress labels Sep 22, 2024
@stevencohn stevencohn added released Available in a released installer and removed next-release Addressed but not yet released labels Sep 22, 2024
weissm pushed a commit to weissm/OneMore that referenced this issue Sep 23, 2024
* Add cell, tablecols, tablerows functions
stevencohn#1551

* math function

* new calculator
stevencohn#1551

* trasnlate error messages

* translations

* translations
weissm pushed a commit to weissm/OneMore that referenced this issue Sep 23, 2024
* Add cell, tablecols, tablerows functions
stevencohn#1551

* math function

* new calculator
stevencohn#1551

* trasnlate error messages

* translations

* translations
weissm pushed a commit to weissm/OneMore that referenced this issue Sep 23, 2024
* Add cell, tablecols, tablerows functions
stevencohn#1551

* math function

* new calculator
stevencohn#1551

* trasnlate error messages

* translations

* translations
weissm pushed a commit to weissm/OneMore that referenced this issue Sep 23, 2024
* Add cell, tablecols, tablerows functions
stevencohn#1551

* math function

* new calculator
stevencohn#1551

* trasnlate error messages

* translations

* translations
weissm pushed a commit to weissm/OneMore that referenced this issue Sep 23, 2024
* Add cell, tablecols, tablerows functions
stevencohn#1551

* math function

* new calculator
stevencohn#1551

* trasnlate error messages

* translations

* translations
weissm pushed a commit to weissm/OneMore that referenced this issue Sep 23, 2024
* Add cell, tablecols, tablerows functions
stevencohn#1551

* math function

* new calculator
stevencohn#1551

* trasnlate error messages

* translations

* translations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high-priority High Priority released Available in a released installer
Projects
None yet
Development

No branches or pull requests

1 participant