emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Andreas Burtzlaff <andy13@gmx.net>
To: RC <recif@yahoo.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Question on spreadsheet formula
Date: Sat, 26 Sep 2009 05:34:09 +0200	[thread overview]
Message-ID: <20090926053409.0f65c53b.andy13@gmx.net> (raw)
In-Reply-To: <loom.20090926T050330-136@post.gmane.org>

Hi,

you could rewrite the formula using vertical sums:

|-----+------+------+-------|
| No. |    P |    E |     B |
|-----+------+------+-------|
|   1 | 5000 | 2000 |  3000 |
|   2 | 7000 | 1000 |  9000 |
|   3 | 5000 | 1000 | 13000 |
#+TBLFM: $4=vsum(@-I$2..@0$2)-vsum(@-I$3..@0$3)

HTH

Andreas


On Sat, 26 Sep 2009 03:08:11 +0000 (UTC)
RC <recif@yahoo.com> wrote:

> Hi,
> On applying the column formula on the table shown below:
>   |-----+------+------+----------|
>   | No. |    P |    E | B        |
>   |-----+------+------+----------|
>   |     |      |      | 0        |
>   |   1 | 5000 | 2000 |          |
>   |   2 | 7000 | 1000 |          |
>   |   3 | 5000 | 1000 |          |
> #+TBLFM: $4=@-1$4+$2-$3
> 
> I get:
>   |-----+------+------+-----------|
>   | No. |    P |    E | B         |
>   |-----+------+------+-----------|
>   |     |      |      | B         |
>   |   1 | 5000 | 2000 | B + 3000  |
>   |   2 | 7000 | 1000 | B + 9000  |
>   |   3 | 5000 | 1000 | B + 13000 |
> #+TBLFM: $4=@-1$4+$2-$3
> 
> When what I would like is:
>   |-----+------+------+-------|
>   | No. |    P |    E | B     |
>   |-----+------+------+-------|
>   |     |      |      | 0     |
>   |   1 | 5000 | 1000 | 3000  |
>   |   2 | 5000 | 1000 | 9000  |
>   |   3 | 5000 | 1000 | 13000 |
> #+TBLFM: $4=@-1$4+$2-$3
> 
> Is there a way I can restrict application of the column formula to below the
> horizontal line.
> Thanks,
> RC
> 
> 
> 
> 
> _______________________________________________
> 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

  parent reply	other threads:[~2009-09-26  3:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-26  3:08 Question on spreadsheet formula RC
2009-09-26  3:14 ` Benjamin Andresen
2009-09-26  3:34 ` Andreas Burtzlaff [this message]
2009-09-27 19:35   ` RC
2009-09-28  6:51     ` Carsten Dominik
2009-09-28 13:56       ` Bernt Hansen

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=20090926053409.0f65c53b.andy13@gmx.net \
    --to=andy13@gmx.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=recif@yahoo.com \
    /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).