emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* calculating column averages
@ 2011-07-22  9:06 Jude DaShiell
  2011-07-22  9:24 ` Rasmus
  2011-07-22 21:48 ` Ken Williams
  0 siblings, 2 replies; 3+ messages in thread
From: Jude DaShiell @ 2011-07-22  9:06 UTC (permalink / raw)
  To: emacs-orgmode

In this case I don't want to tell org-mode how many rows to calculate, and 
I put a table together with an averages line in its own footer section.  I 
prefer when doing these things to output final averages and totals just 
under table headers then go down into detail records after that.  Could 
someone take a look at the following table and tell me how to get an 
average on column 2 of this table?
Cut here.

| Date Stamp             |         Systalic | Diastalic | Pulse |   |   |   |   |   |   |   |
|------------------------+------------------+-----------+-------+---+---+---+---+---+---+---|
| [2011-07-19 Tue 02:26] |              138 |        92 |    74 |   |   |   |   |   |   |   |
| [2011-07-21 Thu 03:50] |              128 |        79 |    76 |   |   |   |   |   |   |   |
| [2011-07-20 Wed 04:03] |              130 |        85 |    74 |   |   |   |   |   |   |   |
| [2011-07-22 Fri 02:33] |              121 |        80 |    79 |   |   |   |   |   |   |   |
|                        |                  |           |       |   |   |   |   |   |   |   |
|------------------------+------------------+-----------+-------+---+---+---+---+---+---+---|
| Averages               | $2=vmean(@<..@>) |           |       |   |   |   |   |   |   |   |
|                        |                  |         - |       |   |   |   |   |   |   |   |
|                        |                  |           |       |   |   |   |   |   |   |   |
  
# Local Variables:
# kept-new-versions: 100
# version-control: t
# End:

-

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: calculating column averages
  2011-07-22  9:06 calculating column averages Jude DaShiell
@ 2011-07-22  9:24 ` Rasmus
  2011-07-22 21:48 ` Ken Williams
  1 sibling, 0 replies; 3+ messages in thread
From: Rasmus @ 2011-07-22  9:24 UTC (permalink / raw)
  To: emacs-orgmode

Jude DaShiell <jdashiel@shellworld.net> writes:

> In this case I don't want to tell org-mode how many rows to calculate, and 
> I put a table together with an averages line in its own footer section.  I 
> prefer when doing these things to output final averages and totals just 
> under table headers then go down into detail records after that.  Could 
> someone take a look at the following table and tell me how to get an 
> average on column 2 of this table?

I am not sure I quite follow but this might be what you're after: 


| Date Stamp             | Systalic | Diastalic | Pulse |
|------------------------+----------+-----------+-------|
| [2011-07-19 Tue 02:26] |      138 |        92 |    74 |
| [2011-07-21 Thu 03:50] |      128 |        79 |    76 |
| [2011-07-20 Wed 04:03] |      130 |        85 |    74 |
| [2011-07-22 Fri 02:33] |      121 |        80 |    79 |
|                        |          |           |       |
|------------------------+----------+-----------+-------|
| Averages               |   129.25 |           |       |
#+TBLFM: @7$2=vmean(@2..@-1)


The field @7$2 calculates the average (vmean) from line 2 (@2) to the
line just above itself (@-1).

–Rasmus

-- 
Sent from my Emacs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: calculating column averages
  2011-07-22  9:06 calculating column averages Jude DaShiell
  2011-07-22  9:24 ` Rasmus
@ 2011-07-22 21:48 ` Ken Williams
  1 sibling, 0 replies; 3+ messages in thread
From: Ken Williams @ 2011-07-22 21:48 UTC (permalink / raw)
  To: emacs-orgmode

Jude DaShiell <jdashiel <at> shellworld.net> writes:

> 
> In this case I don't want to tell org-mode how many rows to calculate, and 
> I put a table together with an averages line in its own footer section.  

Since you have a header & footer, one solution is to use a formula like this:

   :=vmean(@I..@II)

 -Ken

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-22 21:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-22  9:06 calculating column averages Jude DaShiell
2011-07-22  9:24 ` Rasmus
2011-07-22 21:48 ` Ken Williams

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).