emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Stephan Schmitt <drmabuse@cs.tu-berlin.de>
To: Tassilo Horn <tassilo@member.fsf.org>, emacs-orgmode@gnu.org
Subject: Re: Spreadsheet field referencing problem
Date: Thu, 01 Oct 2009 10:43:37 +0200	[thread overview]
Message-ID: <4AC46BB9.3020702@cs.tu-berlin.de> (raw)
In-Reply-To: <87tyyjbmkm.fsf@thinkpad.tsdh.de>

Hi Tassilo,

one solution would be:

| Datum            | Anzahlung | Sonderzahlung | Monatsrate | Restbetrag |
|------------------+-----------+---------------+------------+------------|
|                  |           |               |            |      79000 |
|------------------+-----------+---------------+------------+------------|
| <2009-10-30 Fri> |      7000 |             0 |          0 |      72000 |
| <2009-11-15 Sun> |         0 |             0 |       1000 |      71000 |
| <2009-12-15 Tue> |         0 |             0 |       1000 |      70000 |
#+TBLFM: $5=@-1 - vsum($2..$4)::@2$5=79000

hth,
	Stephan

Tassilo Horn wrote:
> Hi all,
> 
> I have a table like this:
> 
> | Datum            | Anzahlung | Sonderzahlung | Monatsrate | Restbetrag |
> |------------------+-----------+---------------+------------+------------|
> |                  |           |               |            |      79000 |
> |------------------+-----------+---------------+------------+------------|
> | <2009-10-30 Fri> |      7000 |             0 |          0 |            |
> | <2009-11-15 Sun> |         0 |             0 |       1000 |            |
> | <2009-12-15 Tue> |         0 |             0 |       1000 |            |
> 
> In the last column "Restbetrag" I want to have a column formula, so that
> I get these values:
> 
> | Datum            | Anzahlung | Sonderzahlung | Monatsrate | Restbetrag |
> |------------------+-----------+---------------+------------+------------|
> |                  |           |               |            |      79000 |
> |------------------+-----------+---------------+------------+------------|
> | <2009-10-30 Fri> |      7000 |             0 |          0 |      72000 |
> | <2009-11-15 Sun> |         0 |             0 |       1000 |      71000 |
> | <2009-12-15 Tue> |         0 |             0 |       1000 |      70000 |
> 
> So the formula should take the value from the cell above, and substract
> the sum of the other values in that row.  So I came up with the formula
> 
>      #+TBLFM: $5=@-1 - vsum($2..$4)
> 
> but recalculating the table gives that:
> 
> | Datum            | Anzahlung | Sonderzahlung | Monatsrate | Restbetrag         |
> |------------------+-----------+---------------+------------+--------------------|
> |                  |           |               |            | Restbetrag         |
> |------------------+-----------+---------------+------------+--------------------|
> | <2009-10-30 Fri> |      7000 |             0 |          0 | Restbetrag - 7000  |
> | <2009-11-15 Sun> |         0 |             0 |       1000 | Restbetrag - 8000  |
> | <2009-12-15 Tue> |         0 |             0 |       1000 | Restbetrag - 9000  |
> 
> How do I get it right?
> 
> Bye,
> Tassilo
> 
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-10-01  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-01  7:27 Spreadsheet field referencing problem Tassilo Horn
2009-10-01  8:43 ` Stephan Schmitt [this message]
2009-10-01  9:12   ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AC46BB9.3020702@cs.tu-berlin.de \
    --to=drmabuse@cs.tu-berlin.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=tassilo@member.fsf.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).