emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: How to do a sum of products in a table?
Date: Fri, 14 Jun 2013 20:53:04 +0200	[thread overview]
Message-ID: <m28v2cmsmn.fsf@polytechnique.org> (raw)
In-Reply-To: <87y5ac61gn.fsf@pank.home>

Rasmus writes:

> So perhaps you'd want something like this
>
> |   | Name      |     Grade | Question 1 | Question 2 | Question 3 |
> | ! |           |     grade | q1         |            | q3         |
> | _ |           |         g |            |            |            |
> | / | Coeff     |         6 | 1          |          3 | 2          |
> |---+-----------+-----------+------------+------------+------------|
> | * | Foo       |      6.67 | 1/2        |          1 | 1/4        |
> | * | Bar       |      6.67 | 1          |          1 | 0          |
> | * | Baz       |       7.5 | 1          |        3/2 | -1/2       |
> |---+-----------+-----------+------------+------------+------------|
> | _ |           |      mean |            |        max |            |
> |   | Mean      | 6.9444445 | std.dev.   | 0.48112521 |            |
> | $ | Constants |  magic=10 |            |            |            |
> |---+-----------+-----------+------------+------------+------------|
> #+TBLFM: $g=vsum($q1..$q3):: $3=round(@I-1$q1..@I-1$q3*$q1..$q3*$magic/$g,2)::
> #+TBLFM: $mean=vmean(@I$grade..II$grade)::$max=vsdev(@I$grade..II$grade)
>
> It even exports pretty tables so you could hardly wish for more.

Thanks, this is great! I had no idea multiplying ranges would do the
right thing.

Thanks again,

Alan

      reply	other threads:[~2013-06-14 18:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14 14:09 How to do a sum of products in a table? Alan Schmitt
2013-06-14 15:13 ` Rasmus
2013-06-14 16:49   ` Alan Schmitt
2013-06-14 17:34     ` Rasmus
2013-06-14 18:53       ` Alan Schmitt [this message]

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=m28v2cmsmn.fsf@polytechnique.org \
    --to=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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).