Is it possible to perform sum calculation in a confluence table?
Asked by Naama Lev:

Hello,

Is it possible to perform a simple sum calculation in a table in confluence?

Is there any plugin that help to do it?

Thanks

Naama


Answers:
author: Adrien Ragot 2
body: To complete Geert's answer:

* [Advanced Tables for Confluence](https://marketplace.atlassian.com/plugins/org.swift.confluence.table) (paid): Improves Confluence tables
* [Table Enhancer for Confluence](https://marketplace.atlassian.com/plugins/com.tngtech.confluence.plugins.tableenhancer) (free)
* [Spreadsheets for Confluence](https://marketplace.atlassian.com/plugins/com.valiantys.spreadsheets) (paid): Embed spreadsheets
* [Play SQL Spreadsheets](https://marketplace.atlassian.com/plugins/com.playsql.playsql-plugin) (paid): Manage data in Confluence

Disclaimer: I'm the author of Play SQL Spreadsheets.

comments: author: Sascha Ziemann
body: Table Enchancer can not calculate.


author: Sascha Ziemann
body: Play SQL can not work with Confluence tables. The data must be stored in a SQL database.


author: Sascha Ziemann
body: I wish I can down vote.


author: Jaclyn Mazzarella
body: Hi Sascha! There is a paid app called [Excellentable- Spreadsheets for Confluence](https://marketplace.atlassian.com/apps/1211672/excellentable-spreadsheet-for-confluence?hosting=server&tab=overview), where you can perform the SUM formula along with tons of other features. You can try it free for 30 days too! Hope his helps.


author: Andrey Khaneev _StiltSoft_
body: Hello,

There is one more add-on - [Table Filter](https://marketplace.atlassian.com/plugins/com.stiltsoft.confluence.plugin.tablefilter.tablefilter). It has a [Pivot Table macro](https://docs.stiltsoft.com/display/TableFilter/How+to+use+Pivot+table+macro) that allows you to make different calculations on a table.

comments: author: Andrey Khaneev _StiltSoft_
body: Also, there is the [Table Transformer](https://docs.stiltsoft.com/display/public/TFAC/Custom+Transformation+-+use+cases+with+advanced+SQL+queries#CustomTransformation-usecaseswithadvancedSQLqueries-Usingformulas) macro that can do complex calculations.


author: Sascha Ziemann
body: I tried it but this results always in a 2x2 table with 1 value.

![2020-05-26 15_26_49-306_20_15 - Referenzumgebung - K3LS Documentation.png](https://community.atlassian.com/t5/image/serverpage/image-id/96446i4ED1097A229A5F95/image-size/large?v=v2&px=999 "2020-05-26 15_26_49-306_20_15 - Referenzumgebung - K3LS Documentation.png")

Looks pretty ugly. Localization does not work either.


author: Andrey Khaneev _StiltSoft_
body: Please, [see the docs](https://docs.stiltsoft.com/pages/viewpage.action?pageId=42239652#Configuringthepivottable-Sum) on how the Pivot Table macro works.

Also, you can add a [total row / column](https://docs.stiltsoft.com/display/TFAC/Calculations+in+tables) to the table using the Table Filter macro.

Or use Table Transformer macro for more [complex calculations](https://docs.stiltsoft.com/display/TFAC/Custom+Transformation+-+use+cases+with+advanced+SQL+queries#CustomTransformation-usecaseswithadvancedSQLqueries-Usingformulas).

Please, share your use case and I'll recommend the best approach.


author: Sascha Ziemann
body: I have a table with three columns. Columns A and B have always a value. Column C has only in some rows a value. I want to count the rows, in which column C is empty.


author: Andrey Khaneev _StiltSoft_
body: Here are some examples:

Count number of rows with not empty Column C:

![2020-05-27_17h06_12.png](https://community.atlassian.com/t5/image/serverpage/image-id/96627iF06A7B22B381E615/image-size/large?v=v2&px=999 "2020-05-27_17h06_12.png")

Count number of rows with empty Column C:

![2020-05-27_17h07_48.png](https://community.atlassian.com/t5/image/serverpage/image-id/96628i4A7FC8151977D321/image-size/large?v=v2&px=999 "2020-05-27_17h07_48.png")![2020-05-27_17h08_56.png](https://community.atlassian.com/t5/image/serverpage/image-id/96629i009D273CF048E9E5/image-size/large?v=v2&px=999 "2020-05-27_17h08_56.png")

Calculate sum of Column A and Column B in Column C when Column C is not filled with value:

![2020-05-27_17h14_28.png](https://community.atlassian.com/t5/image/serverpage/image-id/96630i9C4AA2C5657A5FF5/image-size/large?v=v2&px=999 "2020-05-27_17h14_28.png")

```
SELECT *,
CASE 
WHEN T1.'Column C' IS NULL THEN T1.'Column A' + T1.'Column B'
ELSE T1.'Column C' 
END AS 'Column C'
FROM T*
```

Let me know if any of theses examples suits your needs.


author: Sascha Ziemann
body: Yes but the result is always a table, although the sum is just one value. Is it possible to get just the sum value in order to put it inline into text paragraph?


author: Andrey Khaneev _StiltSoft_
body: Unfortunately, it is not possible to do these tools.


author: CelesteCS
body: Hello,

In case of [CelesteCS Math](https://marketplace.atlassian.com/apps/1212655/celestecs-math-for-confluence?hosting=server&tab=overview) plug-in you may use the [COUNTA](https://celestecs.com/support/documentation/math/functions#h8-statistical-functions) function in the following manner:

```
There are {COUNTA(Table1.C2, Table1.C3, Table1.C4, Table1.C5) } empty cells in the table.
```

Just add Numerical Expression macro to the page, insert your text insert it and specify the formulas in curly braces. Parameters configuration is described [here](https://celestecs.com/support/documentation/math/parameters).

Thanks!


author: Katerina Rudkovskaya [Stiltsoft]
body: Hi [@Sascha Ziemann](/t5/user/viewprofilepage/user-id/2450983),   

We've released the improvement that allows you to get a single value from Pivot Table as an inline text. Please update the app and use the **Show result as plain text** option.  

![image2022-8-19_12-23-10.png](https://community.atlassian.com/t5/image/serverpage/image-id/220448i57058B14E486C2FB/image-size/large?v=v2&px=999 "image2022-8-19_12-23-10.png")  

Katerina  
Stiltsoft


author: CelesteCS
body: Hello, Naama!

For any calculations in Confluence, including any manipulations with table data, you may use [CelesteCS Math for Confluence](https://marketplace.atlassian.com/plugins/com.celestecs.confluence.celestecs-math). There are versions for both Confluence Server and Confluence Cloud.

Assume you have a table with three columns and three rows on your page -- from A1 till C3, where row 1 is the header row. The sum calculation formula for rows 2 and 3 will be simple:

```
SUM(Table1.A2:C3)
```

There is a plenty of other functions in the macro, so you may perform any calculations using formulas in EXCEL style.

Thanks!

comments: author: Sascha Ziemann
body: 50$ just for a simple sum?


author: CelesteCS
body: Sascha,

Not just for SUM. There are hundreds of functions and it really works.

Thanks!


author: Geert Graat
body: Hi,

There are 2 plugins I know of:

* [Advanced Tables for Confluence](https://marketplace.atlassian.com/plugins/org.swift.confluence.table) (paid)
* [Table Enhancer for Confluence](https://marketplace.atlassian.com/plugins/com.tngtech.confluence.plugins.tableenhancer) (free)

The free one only allows to show a total row. With the paid one you can do more advanced stuff.

Regards,

Geert


author: cirosantilli
body: Possible duplicate of: <https://community.atlassian.com/t5/Answers-Developer-Questions/Calculation-in-tables/qaq-p/570820>


Tags: calculation

table