From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Re: evaluating rows or columns in org-table Date: Wed, 30 Jul 2008 14:05:07 -0400 Message-ID: <87ljzjp7sc.fsf@gollum.intra.norang.ca> References: <489075C5.807@gmail.com> <87od4fqtxp.fsf@gollum.intra.norang.ca> <87d4kvqrki.fsf@gollum.intra.norang.ca> <8763qnqre1.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOG30-0002K1-O6 for emacs-orgmode@gnu.org; Wed, 30 Jul 2008 14:05:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOG2z-0002J8-1y for emacs-orgmode@gnu.org; Wed, 30 Jul 2008 14:05:13 -0400 Received: from [199.232.76.173] (port=59106 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOG2y-0002J2-S3 for emacs-orgmode@gnu.org; Wed, 30 Jul 2008 14:05:12 -0400 Received: from mho-02-bos.mailhop.org ([63.208.196.179]:63401) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KOG2y-0001Qh-Iw for emacs-orgmode@gnu.org; Wed, 30 Jul 2008 14:05:12 -0400 In-Reply-To: (Gabriel Peters's message of "Wed\, 30 Jul 2008 10\:49\:48 -0700") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Gabriel Peters Cc: Kene Meniru , emacs-orgmode@gnu.org "Gabriel Peters" writes: > The blank lines do also pose a problem in different approach, one which will > make use of vector functions in calc. If you allow for no empty lines and one > extra line toward the end of table, this also can do the computation. > > | | Rank | names | grade 1 | grade 2 | grade 3 | Total | Letter grade | > |---+------+------------+---------+---------+---------+-------+--------------| > | # | 1 | student 01 | 91.80 | 96.40 | 97.00 | 95.07 | A | > | # | 2 | student 03 | 92.00 | 95.14 | 97.00 | 94.71 | A | > | # | 3 | student 02 | 88.78 | 89.15 | 98.00 | 91.98 | A | > | # | 4 | student 04 | 84.00 | 74.62 | 88.00 | 82.21 | B | > |---+------+------------+---------+---------+---------+-------+--------------| > #+TBLFM: $2=find(rsort(@I$7..@II$7),$7)::$7=($4+$5+$6)/3;%.2f::$8=if($7 > <60,F,if($7<70,D,if($7<80,C,if($7<90,B,A)))) Cool :) I learn something new everyday! And this doesn't require that you sort the entries first to get it right - so I like Gabriel's solution better. This way you are free to sort the table anyway you like and the data is still correct. -Bernt