Title: Adding all rows in a column
Last modified: August 20, 2016

---

# Adding all rows in a column

 *  Resolved [gabeheter](https://wordpress.org/support/users/gabeheter/)
 * (@gabeheter)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/adding-all-rows-in-a-column/)
 * I’m hoping there is an easy way to add all the rows in a single column if I don’t
   know the number of rows. In Excel you can do something like =SUM(A:A) Is this
   possible?
 * [http://wordpress.org/extend/plugins/tablepress/](http://wordpress.org/extend/plugins/tablepress/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/adding-all-rows-in-a-column/#post-3507903)
 * Hi,
 * thanks for your question.
 * Sorry, but unfortunately I have to disappoint you 🙁 This is not possible, as
   the formula functionality is not sophisticated enough to recognize this. References
   to cells must contain the row number. So, you’ll have to update that formulam
   whenever you add rows.
 * Regards,
    Tobias
 *  Thread Starter [gabeheter](https://wordpress.org/support/users/gabeheter/)
 * (@gabeheter)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/adding-all-rows-in-a-column/#post-3507905)
 * But it can do =SUM(A2:A123) right? I might be able to do some php code stuff 
   to get the number of rows returned and write the variable into the cell? Do you
   think that might be possible?
 *  Thread Starter [gabeheter](https://wordpress.org/support/users/gabeheter/)
 * (@gabeheter)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/adding-all-rows-in-a-column/#post-3507907)
 * Is the math done via javascript after pageload?
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/adding-all-rows-in-a-column/#post-3507909)
 * Hi,
 * yes, `=SUM(A2:A123)` is no problem.
    And yes, using PHP so fill in the number
   should not be a problem. The best approach for that would be to hook into the`
   tablepress_table_raw_render_data` filter hook, which receives the full table (
   as a two-dimension array) as its parameter (see `classes/class-render.php`).
 * Note that this solution requires the current TablePress development version from
   [http://tablepress.org/download/extension/tablepress-dev.zip](http://tablepress.org/download/extension/tablepress-dev.zip),
   as this filter hook is not yet part of the current stable version.
 * Another solution, which is very similar, could to use the `[table-info]` Shortcode(
   explained a little bit in the documentation at [http://tablepress.org/documentation/](http://tablepress.org/documentation/)).
   In the development version, this has received another parameter, that allows 
   to retrieve the number of rows of a table, see [http://wordpress.org/support/topic/table-info-total-number-of-rows](http://wordpress.org/support/topic/table-info-total-number-of-rows)
   
   If you combine that with the TablePress Extension that I briefly describe here
   [http://wordpress.org/support/topic/calling-other-table-cell-values-from-another-table#post-3818970](http://wordpress.org/support/topic/calling-other-table-cell-values-from-another-table#post-3818970),
   it should be possible to use a formula like
 *     ```
       =SUM(A2:A[table-info id=123 field="number_rows" /])
       ```
   
 * inside a table (here table ID 123) that is loaded with the Shortcode
 *     ```
       [table id=123 shortcodes_before_formulas=true /]
       ```
   
 * Regards,
    Tobias
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/adding-all-rows-in-a-column/#post-3507910)
 * Hi,
 * and for your other question: No, the math is done in PHP, before the table HTML
   is created.
 * Regards,
    Tobias
 *  Thread Starter [gabeheter](https://wordpress.org/support/users/gabeheter/)
 * (@gabeheter)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/adding-all-rows-in-a-column/#post-3507911)
 * Thanks, Very helpful.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/adding-all-rows-in-a-column/#post-3507912)
 * Hi,
 * sure, no problem! You are very welcome!
    I hope this information helps to get
   this working for you.
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](http://wordpress.org/support/view/plugin-reviews/tablepress)
   here in the plugin directory. Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Adding all rows in a column’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

## Tags

 * [add](https://wordpress.org/support/topic-tag/add/)
 * [columns](https://wordpress.org/support/topic-tag/columns/)
 * [sum](https://wordpress.org/support/topic-tag/sum/)

 * 7 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/adding-all-rows-in-a-column/#post-3507912)
 * Status: resolved