I am trying to display the remaining amount in the last row / column using the advanced tables plugin but I cannot figure out the correct formula. My current attempt gives me an error saying the formula cannot be parsed. The expected result would be 47.00.
| **Type** | **Test 1** | Test 2 |
|----|----|:---:|
| Value 1 | 47.00 | |
| Value 2 | 1236.82 | x |
| **Total** | 1283.82 | |
<!-- TBLFM: @>$2=sum(@I..@-1);%.2f::@>$3=sum(if($3 != "x", $2, 0)) -->
The formula did not seem to render, but it’s: TBLFM: @>$2=sum(@I..@-1);%.2f::@>$3=sum(if($3 != “x”, $2, 0))
When you post example Markdown, HTML, or other code, you need to mark it as code to prevent the forum software from rendering or garbling it. I’ve edited this post to do that for you. Good luck!
Helper column
You need a 4th column to do a conditional sum (“Sum B only if C is empty”).
| Type |
Test 1 |
Excluded |
Remaining |
| Value 1 |
47.00 |
|
47.00 |
| Value 2 |
1236.82 |
x |
0.00 |
| Total |
1283.82 |
|
47.00 |
Give this a try:
<!-- TBLFM: @2$4..@3$4=if("$3" == "x", 0, $2);%.2f::@>$2=sum(@I..@-1);%.2f::@>$4=sum(@I..@-1);%.2f -->