Hi,
thanks for your question and sorry for the trouble!
Yes, due to implementation aspects, Shortcodes are evaluated after formulas, which is why this does not work. However, there’s a TablePress Extension at https://tablepress.org/extensions/shortcodes-before-formulas/ that can used to switch this order. Just install and activate that as a regular WordPress plugin and extend your table’s Shortcode to
[table id=123 shortcodes_before_formulas=true /]
Another and easier approach would be to use a cell reference to a hidden cell.
For example, you could add a new first row to the table and hide it via the corresponding button on the “Edit” screen of the table.
Then, cell A1 could contain that referenced value, and you could use “A1” anywhere in the formulas to reference it.
Regards,
Tobias
Thread Starter
Michael
(@taloscent)
Understood. Using the extension I get the formula to work.
Is there a way to add some formatting to the cell for example if I wanted a $ in front of the resulting number?
Using your more simple suggestion, can a cell reference a cell in another table? The goal here being to be able to edit a value either in a shortcode or in a cell that is then referenced across multiple tables on multiple pages.
Hi,
good to hear that the Extension helps! 🙂
No, formatting the results of a formula evaluation is not possible at the moment, sorry. 🙁 That would require some custom coding, e.g. by hooking into one of the plugin filter hooks and manually adding the $ sign for the relevant cells.
Referencing a cell from another table is not directly possible with “plain” formulas, but you can use a Shortcode as well. Please see the thread at http://wordpress.org/support/topic/calling-other-table-cell-values-from-another-table for more information on that (that’s actually the thread where the above mentioned Extension comes from).
Regards,
Tobias
Thread Starter
Michael
(@taloscent)
Thank you for that reference. I will explore that option. Thanks for taking time out of your life to continue to support this.
Hi,
no problem, you are very welcome! 🙂 Hope that links helps!
If you still have problems, just let me know!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!