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

horizontal sums #70

Open
JohannaTe opened this issue Oct 2, 2023 · 4 comments
Open

horizontal sums #70

JohannaTe opened this issue Oct 2, 2023 · 4 comments

Comments

@JohannaTe
Copy link

JohannaTe commented Oct 2, 2023

Hi,

I'm having troubles getting a sum going that is more than two cells horizontally. The system tells me it cannot parse it. Would you be able to let me know how to fix this?

Thanks so much! Jo

This does not work:

I II III iv sum
2 3 5 6
Screenshot 2023-10-03 at 7 55 06 AM
@khorton
Copy link

khorton commented Oct 3, 2023

Each individual math operation must be enclosed in parentheses.

Try:

| I   | II  | III | iv  | sum |
| --- | --- | --- | --- | --- |
| 2   | 3   | 5   | 6   | 16  |
<!-- TBLFM: @2$5=(@2$1+(@2$2+(@2$3+@2$4))) -->

@khorton
Copy link

khorton commented Oct 3, 2023

Also, you can leave out the column specifier "@2". This is less typing, and it will allow one formula to work for several rows.

| I   | II  | III | iv  | sum |
| --- | --- | --- | --- | --- |
| 2   | 3   | 5   | 6   | 16  |
| 3   | 4   | 6   | 7   | 20  |
<!-- TBLFM: $5=($1+($2+($3+$4))) -->

@JohannaTe
Copy link
Author

Fantastic! Thanks so much, works like a charm.

@sbliven
Copy link

sbliven commented May 29, 2024

Or even more concisely,

<!-- TBLFM: $5=sum($1..$4) -->

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

3 participants