emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Calc: Second to last row
Date: Wed, 31 Aug 2016 18:21:09 -0400	[thread overview]
Message-ID: <87pooo8tre.fsf@gmail.com> (raw)
In-Reply-To: 2016-08-31T17-06-58@devnull.Karl-Voit.at

Karl Voit <devnull@Karl-Voit.at> writes:

> Hi!
>
> I would like to refer to the second to last row of a table.
>
> The following example should demonstrate my issue. What I expect is
> that the following formula is filling @2..@5 with "1" and in the
> last row, there is the sum of all "1".
>
> It is important to me to ignore the number of horizontal lines since
> their number varies in my case.
>
> | Values |
> |--------|
> |        |
> |        |
> |--------|
> |        |
> |        |
> |--------|
> |        |
>
> #+TBLFM: @2$1..@>-1$1=1 :: @>$1=vsum(@2$1..@>-1$1)

This should be:

#+TBLFM: @2$1..@>>$1=1 :: @>$1=vsum(@2$1..@>>$1)

>
> Expected result:
>
> | Values |
> |--------|
> |      1 |
> |      1 |
> |--------|
> |      1 |
> |      1 |
> |--------|
> |      4 |
>
> Actual result: "user-error: Several field/range formulas try to set
> @8$1".
>
> With a fixed number of horizontal lines, the sum would be:
>
> #+TBLFM: @>$1=vsum(@2$1..@III$1);T
>
> So how can this be accomplished for an arbitrary number of
> horizontal lines?
>
>
> At my side: Org-mode version 8.3.4 (release_8.3.4-33-gd522fc)

-- 
Nick

  reply	other threads:[~2016-09-01  9:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31 15:14 Calc: Second to last row Karl Voit
2016-08-31 22:21 ` Nick Dokos [this message]
2016-09-01  8:53 ` Karl Voit

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=87pooo8tre.fsf@gmail.com \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.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).