---
title: "Column calculation with Native Table Enhancer [Beta] macro"
canonical: "https://support.appfire.com/space/TBL/3565584387/Column%20calculation%20with%20Native%20Table%20Enhancer%20%5BBeta%5D%20macro"
format: markdown
---
> Macro (aura-html)

The Native Table Enhancer macro enables you to perform simple and conditional column calculations and display summarized values at each column level.

> ⚠️ The Native Table Enhancer macro is currently in beta. [Learn more](https://appfire.atlassian.net/wiki/spaces/TBL/pages/3520037211).

## **Column calculation**

The **Column calculation** feature supports the following calculation types: **Sum**, **Average**, **Minimum**, **Maximum**, **Count**, and **Distinct**. You can configure the Sum-up type for each column independently.

- You can configure column calculations only in macro setup mode and cannot change them in Confluence page view mode.
- You can summarize specific rows with conditions (**SUMIF** and **COUNTIF**)
  - For **Sum** and **Count, **the macro provides **conditional calculations** to summarize only the values in rows that match the condition. This works like SUMIF and COUNTIF in spreadsheets. The condition can use any column in the table, not only the column you are calculating.
- The macro adds a summarized row below the table header.
- The macro displays the configured Sum-up values in the Confluence page view mode.

## Manage column calculations

> Macro (refined-tabs)
> 
> > Macro (refined-tab)
> 
> You can perform the following column calculations.
> 
> | **Type** | **Description** | **Column type** | **Indicator on the Confluence page** |
> | --- | --- | --- | --- |
> | None | Disables the column calculation: no value is displayed for the column | Any | Not applicable |
> | Sum | Calculates the total of all values in the column | Numeric | Total of all values: **Sum** |
> | Add a condition to sum only the values in rows that match the condition. | Numeric | Total of values with an applied condition: **SUMIF** |
> | Average | Calculates the average of all values in the column | Numeric | **Avg** |
> | Minimum | Returns the lowest numerical value in the column | Numeric | **Min** |
> | Maximum | Returns the highest numerical value in the column | Numeric | **Max** |
> | Count | Counts the total number of non-empty cells in the column | Numeric, String, Date | Count of non-empty cells: **Cnt** |
> | Add a condition to count only rows that match the condition. | Numeric, String, Date | Counts only the cells that match the condition*: ***COUNTIF** |
> | Distinct | Counts unique values only, ignoring duplicates and empty cells | Numeric, String, Date | **Disct** |
> 
> > Macro (refined-tab)
> 
> > ℹ️ You need edit permissions to access the macro setup mode.
> 
> 1. To configure **column calculation**, edit the macro to open the setup mode. Refer to [Set up the Native Table Enhancer macro features](https://appfire.atlassian.net/wiki/spaces/TBL/pages/3568173057). Each column in the table has an *Edit column *( ) option.
> 2. To set up the column calculation for any column, navigate to **Edit column** > **Edit column calculation**. For example, for the **Stock Qty** column, click **Edit column calculation**.
> 3. The *Edit column calculation* dialog opens. Select the required Sum-up type, and click **Save**. For example, for the **Stock Qty** column, **Sum** is selected.
> 
> > 📝 - For the String and Date column types, the *Edit* *column calculation* dialog displays *None*, *Count*, and *Distinct*.
> 
> 4. The summarized row appears as the first row below the table header and displays the configured sum-up values. For example: **Category** - Distinct, **Product ID** - Count, **Unit Price** - Max, **Stock Qty** - Sum, **Reorder Level** - Average.
> 
> 5. Click **Save** and **Publish** the page. You can view the configured summary values in the Confluence page view mode.
> 
> > Macro (refined-tab)
> 
> > ℹ️ You need edit permissions to access the macro setup mode.
> 
> For **Sum** and **Count **calculation types, you can **add a condition** to summarize only the values in rows that match the condition.
> 
> **Apply conditional column calculation to numeric column type**
> 
> **Example 1 - Sum values for one specific category: **In the **Annual Maintenance** column, use **Sum** with a conditional calculation on the **Category** column* *value* Hardware*. The summarized row shows the total maintenance cost for Hardware items only.
> 
> - To configure a conditional column calculation, edit the macro to open the setup mode. Refer to [Set up the Native Table Enhancer macro features](https://appfire.atlassian.net/wiki/spaces/TBL/pages/3568173057). Each column in the table has an *Edit column *( ) option.
> - To set up the conditional column calculation for any numeric column, navigate to **Edit column** > **Edit column calculation**. For example, for the **Annual Maintenance($)** column, click **Edit column calculation**.
> - The *Edit column calculation* dialog opens. To perform a conditional calculation on the **Annual Maintenance** column, select the required **Sum-up type** as **Sum**.
> - The **Add condition** toggle is off by default, and the macro calculates the total of all values in the column.
>   - To add a condition to the **Annual Maintenance** column calculation, enable the **Add condition **toggle.
>   - When the Sum-up type is set to Sum, the **Add condition** lets you sum only the values of rows that match a specific condition.
>     - The first dropdown selector lists the table column names.
>     - The second dropdown selector lists the conditions available for the column type selected in the first dropdown.
>     - The third dropdown selector lists the values for the column selected in the first dropdown. For numeric column types, it displays an input field for numeric column values.
>     - For example, the condition for the **Annual Maintenance** column sums all **Annual Maintenance** column values where the **Category** column value is *Hardware.*
>     - To apply the condition, click **Save**.
>     - The macro setup mode displays the summarized value just below the **Annual Maintenance** column header. The Sum-up indicator (for example, SUMIF) displays the condition type. Hover over the indicator to view the applied condition.
>     - Click **Save** and then **Publish** the page. You can view the summarized values in the Confluence page view mode.
> 
> 
> **Apply conditional column calculation to string column type**
> 
> For the **String** and **Date** column types, the *Edit* *column calculation* dialog displays *None*, *Count*, and *Distinct*.
> 
> **Example 2**- **Count items with low stock**:** **In the **Stock Status** column, use **Count** with a condition on the ***Stock Qty ****column *where the value* ****is less than or equal to 5***. The summarized row shows how many items are low on stock.
> 
> - For the **Stock** **Status** column, navigate to **Edit column** > **Edit column calculation**.
> - Select the required Sum-up type; for example, for the **Stock** **Status** column, select **Count**. The **Add condition** toggle is off by default, and the macro returns the total number of non-empty cells in the column.
> - To add a condition to the **Stock** **Status** column calculation, enable the **Add condition **toggle.
> - In the condition dropdowns, select **Stock Qty**, select **less than or equal to**, and enter **5**.
> - The applied condition for the **Stock** **Status **column counts non-empty rows where the **Stock Qty** column value is *less than or equal to* 5.
> - To apply the condition, click **Save**.
> - The macro setup mode displays the summarized value just below the **Stock** **Status **column header. The Sum-up indicator (for example, COUNTIF) indicates that a condition is applied. Hover over the indicator to view the applied condition.
> - Click **Save** and then **Publish** the page. You can view the summarized values in the Confluence page view mode.
> 
> 
> > Macro (refined-tab)
> 
> To disable the configured Sum-up value for any column, navigate to the *Edit column calculation* dialog and select **None**.
> 
> For example, to disable the column calculation for the **Stock** **Status** column:
> 
> 1. For the **Stock Status** column, navigate to **Edit column** > **Edit column calculation**.
> 2. Select **None**, and click **Save**.