From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: evaluating rows or columns in org-table Date: Wed, 30 Jul 2008 12:16:22 -0400 Message-ID: <8763qnqre1.fsf@gollum.intra.norang.ca> References: <489075C5.807@gmail.com> <87od4fqtxp.fsf@gollum.intra.norang.ca> <87d4kvqrki.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 1KOELj-000795-Mo for emacs-orgmode@gnu.org; Wed, 30 Jul 2008 12:16:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOELj-00078m-3W for emacs-orgmode@gnu.org; Wed, 30 Jul 2008 12:16:27 -0400 Received: from [199.232.76.173] (port=47182 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOELi-00078d-UA for emacs-orgmode@gnu.org; Wed, 30 Jul 2008 12:16:27 -0400 Received: from mho-02-bos.mailhop.org ([63.208.196.179]:54362) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KOELi-0000sG-Kk for emacs-orgmode@gnu.org; Wed, 30 Jul 2008 12:16:26 -0400 In-Reply-To: <87d4kvqrki.fsf@gollum.intra.norang.ca> (Bernt Hansen's message of "Wed\, 30 Jul 2008 12\:12\:29 -0400") 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: Kene Meniru Cc: emacs-orgmode@gnu.org Sorry that last post was unfinished. Here's my attempt at fixing the student rank | | Rank | names | grade 1 | grade 2 | grade 3 | Total | Letter grade | |---+------+------------+---------+---------+---------+-------+--------------| | # | 1 | student 01 | 91.80 | 96.40 | 97.00 | 95.07 | A | | # | 3 | student 03 | 92.00 | 95.14 | 97.00 | 94.71 | A | | # | 2 | student 02 | 88.78 | 89.15 | 98.00 | 91.98 | A | | # | 4 | student 04 | 84.00 | 74.62 | 88.00 | 82.21 | B | #+TBLFM: $7=($4+$5+$6)/3;%.2f::$8=if($7<60,F,if($7<70,D,if($7<80,C,if($7<90,B,A))))::@2$2=1::$2=@-1+1 You can sort the table by the total column descending to get the rank. If you sort the resulting table like this: 1) Position cursor on any total value 2) M-x org-table-sort-lines 3) N (for reverse numeric sort) Then update the Rank column with C-u C-u C-c C-c anywhere in the table the rank numbers are recomputed starting from 1 on the first row. I hope your blank lines aren't too important because sorting puts them all at the bottom of the table. Does that do what you want? -Bernt