[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] How to do a sum of products in a table?
From: |
Rasmus |
Subject: |
Re: [O] How to do a sum of products in a table? |
Date: |
Fri, 14 Jun 2013 17:13:24 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Hi Alan,
> I'm grading an exam, and I'm trying to use org instead of Numbers to
> tabulate the results. For each student, I'll input how well he answered
> to the question, and his grade will be (sum of mark * coefficient),
> where each question has a different coefficient (in Numbers I was using
> the SUMPRODUCT function).
>
> Is there a way to do this in org mode?
Sure, but please provide an example. E.g. is each student a column?
Or is the dotproduct of two vectors where mark is just one
Here's a prtty simple example
| | nr. | score | score |
|---+-----+-----------+-------|
| # | 1 | [1, 2, 3] | 4.2 |
| # | 2 | [3, 4, 5] | 7.8 |
#+TBLFM: $4=$3*[.3, .6, .9]
It would probably be nicer to have the weighting matrix externally
defined. Perhaps you can use #+CONSTANTS or the remote function. If
you prefer you can also let each
A more advance example is given in the manual:
http://orgmode.org/org.html#Advanced-features
|---+---------+--------+--------+--------+-------+------|
| | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
|---+---------+--------+--------+--------+-------+------|
| ! | | P1 | P2 | P3 | Tot | |
| # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
| ^ | | m1 | m2 | m3 | mt | |
|---+---------+--------+--------+--------+-------+------|
| # | Peter | 10 | 8 | 23 | 41 | 8.2 |
| # | Sam | 2 | 4 | 3 | 9 | 1.8 |
|---+---------+--------+--------+--------+-------+------|
| | Average | | | | 25.0 | |
| ^ | | | | | at | |
| $ | max=50 | | | | | |
|---+---------+--------+--------+--------+-------+------|
#+TBLFM:
$6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@address@hidden);%.1f
Refer to
http://orgmode.org/org.html#The-spreadsheet
–Rasmus
--
Hooray!