Support » Plugin: TablePress » Formulas in tables

Viewing 15 replies - 1 through 15 (of 45 total)
• Plugin Author TobiasBg

(@tobiasbg)

Hi,

yes, as briefly mentioned on the plugin website, you can have formulas, similar to those in Excel, in your table. I haven’t yet had the time to thoroughly document this, but it’s pretty much straight forward:
Here are two basic examples:

``=A1+B3``

will sum the cells A1 and B3.

``=AVERAGE(C3:C10)``

will calculate the average value of the cells from C3 through C10.

Regards,
Tobias

danicasati

(@danicasati)

Thank you.
Any sheet with all available formulas on your website?

Plugin Author TobiasBg

(@tobiasbg)

Hi,

no, there’s no such sheet yet, as I just didn’t have the time yet 🙁 Sorry. But I like the idea, and I will try to create a list for the documentation!

However, here’s a list of the available math functions, that I directly extracted from the plugin’s source code. Maybe that is helpful for now.

sin, sinh, arcsin, asin, arcsinh, asinh, cos, cosh, arccos, acos, arccosh, acosh, tan, tanh, arctan, atan, arctanh, atanh, sqrt, abs, ln, log, exp, floor, ceil, average, max, min, mod, pi, power, round, sum, rand_int, rand_float

Best wishes,
Tobias

danicasati

(@danicasati)

I love this plugin, I gave you 5 stars!
Keep good work!

Plugin Author TobiasBg

(@tobiasbg)

Hi,

thank you, that’s very nice! I really appreciate it!

Best wishes,
Tobias

vhmetals

(@vhmetals)

Tobias,

Thank you for providing the above examples. The examples are very helpful. I have tablepress on my silver website. I need to insert a more complicated mathematical formula. Based on the information you provided, it will look something like this:

=C2 x .925 x .90 x (silver spot price)

I have two issues:

1. The table does not perform multiplication. The following error is displayed:

“!ERROR! expecting operator, implicit multiplication not allowed.”

2. I need the formula to calculate the current price of silver. I cannot enter a set amount (for example, 28.89). The price of silver changes constantly.

Is there a way to input the price of silver from the following code:

<object width=”336″ height=”180″>
<param name=”movie” value=”http://www.monex.com/ichart/inter_chart.swf” />
<embed src=”http://www.monex.com/ichart/inter_chart.swf” width=”336″ height=”180″>
</embed>
</object>

The above code is from Monex.com. It provides the current price for silver, gold, platinum, and palladium.

Plugin Author TobiasBg

(@tobiasbg)

Hi,

First: No, importing the price from an external source is not possible. I suggest that you designate a special cell in the table that holds the price, which you manually update (I will assume you choose cell A4).

With that, the formula in the cell would become

``=C2*0.925*0.90*A4``

Regards,
Tobias

vhmetals

(@vhmetals)

One other issue. The chart only recognizes whole numbers when computing mathematical equations. I need it to recognize decimals as well.

vhmetals

(@vhmetals)

Thanks for your response and suggestion about a separate column for spot price. This may be the best temporary solution.

Plugin Author TobiasBg

(@tobiasbg)

Hi,

it will recognize decimals, but only if you use the dot `.` as the decimal separator, instead of a comma `,`. If you need the `,` for visual purposes, I suggest to create a second (hidden) column with the same data, but different decimal separators.

Regards,
Tobias

vhmetals

(@vhmetals)

I am not using any commas. I only use dots. But it still show up as an error.

vhmetals

(@vhmetals)

I am using the following formula to calculate silver melt value:

=C2*0.925*0.90*E2

vhmetals

(@vhmetals)

!ERROR! C2 does not contain a number or expression 28.84

Plugin Author TobiasBg

(@tobiasbg)

Hi,

it looks like there’s a space after the 82.11. Could you check that?
(Could catch by the way, I’ll see if I can make the formula parser ignore such spaces. The best way is to not have them though.)

Regards,
Tobias

vhmetals

(@vhmetals)

It works! Thank you so much. I deleted the space. Now I have two other issues. Is there a way to add a dollar sign in column D and E without throwing off the code. Also, is there a way to only display two digits after the decimal point instead of 6 digits. For example,
the final product in column D should look like this:

\$1971.40

Viewing 15 replies - 1 through 15 (of 45 total)
• The topic ‘Formulas in tables’ is closed to new replies.