[Tex/LaTex] Can LaTeX perform calculation like Excel formula table

calculations

I wonder if this feature is available in TeX system? For example, given a formula within a table, it can apply the formula and display data after the calculation.

Best Answer

There is the package spreadtab which provides spreadsheet like features. These examples are taken from the documentation:

\documentclass{article}
\usepackage{spreadtab}
\begin{document}

\begin{spreadtab}{{tabular}{rr|r}}
 22       & 54       & a1+b1 \\
 43       & 65       & a2+b2 \\
 49       & 37       & a3+b3 \\
 \hline
 a1+a2+a3 & b1+b2+b3 & a4+b4
\end{spreadtab}

\begin{spreadtab}{{tabular}{|r|ccc|}}
 \hline
 @ values of $x$ & -5       &        -1 &        4 \\
 @ $f(x)=2x$     & 2*[0,-1] &  2*[0,-1] & 2*[0,-1] \\
 \hline
\end{spreadtab}

\begin{spreadtab}{{tabular}{|c|*{10}{c}|}}
 \hline
 @$\times$        & 1                     & \STcopy{>}{b1+1}  & & & & & & & & \\
 \hline
 1                & \STcopy{>,v}{!a2*b!1} &                   & & & & & & & & \\
 \STcopy{v}{a2+1} &                       &                   & & & & & & & & \\
                  &                       &                   & & & & & & & & \\
                  &                       &                   & & & & & & & & \\
                  &                       &                   & & & & & & & & \\
                  &                       &                   & & & & & & & & \\
                  &                       &                   & & & & & & & & \\
                  &                       &                   & & & & & & & & \\
                  &                       &                   & & & & & & & & \\
                  &                       &                   & & & & & & & & \\
 \hline
\end{spreadtab}

\end{document}

enter image description here