emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Variable table length
@ 2013-06-03 12:54 Marcin Borkowski
  2013-06-03 13:38 ` Michael Brand
  0 siblings, 1 reply; 5+ messages in thread
From: Marcin Borkowski @ 2013-06-03 12:54 UTC (permalink / raw)
  To: Org-mode mailing list

Hello again,

and one more question.  I'd like to use Org's spreadsheet to create an
amortization schedule for a loan.  It would be best if the number of
rows (excluding the header and footer row) could be variable ande.g.
derived from some property.  Is it possible in Org?  If so, how?

Regards,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Variable table length
  2013-06-03 12:54 Variable table length Marcin Borkowski
@ 2013-06-03 13:38 ` Michael Brand
  2013-06-03 14:32   ` Michael Brand
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Brand @ 2013-06-03 13:38 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Org-mode mailing list

Hi Marcin

On Mon, Jun 3, 2013 at 2:54 PM, Marcin Borkowski <mbork@wmi.amu.edu.pl> wrote:
> and one more question.  I'd like to use Org's spreadsheet to create an
> amortization schedule for a loan.  It would be best if the number of
> rows (excluding the header and footer row) could be variable ande.g.
> derived from some property.  Is it possible in Org?  If so, how?

This is not possible. At least checking the number of rows is possible
with "vlen(@I..@>>) or similar.

I would use one row per payback and manually add/remove rows until the
last row is the only one with a different sign for the floating loan.

Michael

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Variable table length
  2013-06-03 13:38 ` Michael Brand
@ 2013-06-03 14:32   ` Michael Brand
  2013-06-03 18:07     ` Marcin Borkowski
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Brand @ 2013-06-03 14:32 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: Org-mode mailing list

Hi Marcin

On Mon, Jun 3, 2013 at 3:38 PM, Michael Brand
<michael.ch.brand@gmail.com> wrote:
> I would use one row per payback and manually add/remove rows until the
> last row is the only one with a different sign for the floating loan.

Forgot to mention that if you don't need all the intermediate steps
per payback rate then you can of course simply use the annuity
functions from Emacs Calc:
(info "(calc) Related Financial Functions")
or
http://www.gnu.org/software/emacs/manual/html_node/calc/Related-Financial-Functions.html

Michael

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Variable table length
  2013-06-03 14:32   ` Michael Brand
@ 2013-06-03 18:07     ` Marcin Borkowski
  2013-06-03 19:15       ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Marcin Borkowski @ 2013-06-03 18:07 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-06-03, o godz. 16:32:20
Michael Brand <michael.ch.brand@gmail.com> napisał(a):

> Hi Marcin
> 
> On Mon, Jun 3, 2013 at 3:38 PM, Michael Brand
> <michael.ch.brand@gmail.com> wrote:
> > I would use one row per payback and manually add/remove rows until
> > the last row is the only one with a different sign for the floating
> > loan.
> 
> Forgot to mention that if you don't need all the intermediate steps
> per payback rate then you can of course simply use the annuity
> functions from Emacs Calc:
> (info "(calc) Related Financial Functions")
> or
> http://www.gnu.org/software/emacs/manual/html_node/calc/Related-Financial-Functions.html

Thanks, I am aware of that - but what I want is actually a table (I'm
teaching an introductory course in financial mathematics).

> Michael

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Variable table length
  2013-06-03 18:07     ` Marcin Borkowski
@ 2013-06-03 19:15       ` Nick Dokos
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Dokos @ 2013-06-03 19:15 UTC (permalink / raw)
  To: emacs-orgmode

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Dnia 2013-06-03, o godz. 16:32:20
> Michael Brand <michael.ch.brand@gmail.com> napisał(a):
>
>> Hi Marcin
>> 
>> On Mon, Jun 3, 2013 at 3:38 PM, Michael Brand
>> <michael.ch.brand@gmail.com> wrote:
>> > I would use one row per payback and manually add/remove rows until
>> > the last row is the only one with a different sign for the floating
>> > loan.
>> 
>> Forgot to mention that if you don't need all the intermediate steps
>> per payback rate then you can of course simply use the annuity
>> functions from Emacs Calc:
>> (info "(calc) Related Financial Functions")
>> or
>> http://www.gnu.org/software/emacs/manual/html_node/calc/Related-Financial-Functions.html
>
> Thanks, I am aware of that - but what I want is actually a table (I'm
> teaching an introductory course in financial mathematics).
>

Use babel perhaps? Not sure what your inputs are and what your table
should look like but you could use something like this to produce a
skeleton table of the right length and a set of column formulas (nb:
fake ones used below), then C-C C-c on the #+tblfm: line to calculate
the rest of the table:

--8<---------------cut here---------------start------------->8---
#+begin_src sh :results raw :var n=20
echo "#+name: amorttable"
echo "|month | interest | principal | balance |"
for i in $(seq 1 $n)
do
   echo "| $i ||||"
done
echo '#+tblfm: $2 = 2 * $1 :: $3 = 3 * $1 :: $4 = 4 * $1'
#+end_src
--8<---------------cut here---------------end--------------->8---

-- 
Nick

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-03 19:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-03 12:54 Variable table length Marcin Borkowski
2013-06-03 13:38 ` Michael Brand
2013-06-03 14:32   ` Michael Brand
2013-06-03 18:07     ` Marcin Borkowski
2013-06-03 19:15       ` Nick Dokos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).