emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* spreadsheet sum a column
@ 2010-12-02 10:29 Antony
  2010-12-02 16:13 ` Michael Brand
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Antony @ 2010-12-02 10:29 UTC (permalink / raw)
  To: emacs-orgmode

Hi

I have a simple need (from a requirement description point).

I have table like

| foo       | amount |
|-----------+--------|
|           |    <5> |
| hello     |    100 |
| again     |    200 |
| once more |    300 |
|           |        |
|           |        |

I need to be able sum those numbers and say 600 somewhere (I am ok if it 
does in the same table or outside of it)

When I add a new row, say

| foo       | amount |
|-----------+--------|
|           |    <5> |
| hello     |    100 |
| again     |    200 |
| once more |    300 |
| qqq       |    100 |
|           |        |

Now I need to be able to change the 600 to 700 (by pressing C-c C-c 
somewhere)

I am finding it hard to figure out how to do this.

-Antony

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

* Re: spreadsheet sum a column
  2010-12-02 10:29 spreadsheet sum a column Antony
@ 2010-12-02 16:13 ` Michael Brand
  2010-12-02 16:59 ` Detlef Steuer
  2010-12-03 13:10 ` Antony
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Brand @ 2010-12-02 16:13 UTC (permalink / raw)
  To: Antony; +Cc: emacs-orgmode

On Thu, Dec 2, 2010 at 11:29, Antony <lisp.linux@gmail.com> wrote:
> I have table like
>
> | foo       | amount |
> |-----------+--------|
> |           |    <5> |
> | hello     |    100 |
> | again     |    200 |
> | once more |    300 |
> |           |        |
> |           |        |
>
> I need to be able sum those numbers and say 600 somewhere (I am ok if it
> does in the same table or outside of it)
>
> When I add a new row, say
>
> | foo       | amount |
> |-----------+--------|
> |           |    <5> |
> | hello     |    100 |
> | again     |    200 |
> | once more |    300 |
> | qqq       |    100 |
> |           |        |
>
> Now I need to be able to change the 600 to 700 (by pressing C-c C-c
> somewhere)
>
> I am finding it hard to figure out how to do this.

Press C-c C-c on the TBLFM line after every change:
| foo       | amount |
|-----------+--------|
| hello     |    100 |
| again     |    200 |
| once more |    300 |
|-----------+--------|
|           |    600 |
#+TBLFM: $LR2 = vsum(@I$2..@-1$2)

I don't think `<5>' is of any use in this case.

Michael

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

* Re: spreadsheet sum a column
  2010-12-02 10:29 spreadsheet sum a column Antony
  2010-12-02 16:13 ` Michael Brand
@ 2010-12-02 16:59 ` Detlef Steuer
  2010-12-03 13:10 ` Antony
  2 siblings, 0 replies; 4+ messages in thread
From: Detlef Steuer @ 2010-12-02 16:59 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, 02 Dec 2010 02:29:56 -0800
Antony <lisp.linux@gmail.com> wrote:

> Hi
> 
> I have a simple need (from a requirement description point).
> 
> I have table like
> 
> | foo       | amount |
> |-----------+--------|
> |           |    <5> |
> | hello     |    100 |
> | again     |    200 |
> | once more |    300 |
> |           |        |
> |           |        |
> 
> I need to be able sum those numbers and say 600 somewhere (I am ok if it 
> does in the same table or outside of it)
> 
> When I add a new row, say
> 
> | foo       | amount |
> |-----------+--------|
> |           |    <5> |
> | hello     |    100 |
> | again     |    200 |
> | once more |    300 |
> | qqq       |    100 |
> |           |        |
> 
> Now I need to be able to change the 600 to 700 (by pressing C-c C-c 
> somewhere)

| foo       | amount |
|-----------+--------|
|           |        |
| hello     |    100 |
| again     |    200 |
| once more |    300 |
| qqq       |    100 |
|           |    700 |
#+TBLFM: @7$2=vsum(@3..@-1)

You find information about that in the manual under "spreadsheet".

Hth
Detlef


> 
> I am finding it hard to figure out how to do this.
> 
> -Antony
> 
> 
> 
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 

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

* Re: spreadsheet sum a column
  2010-12-02 10:29 spreadsheet sum a column Antony
  2010-12-02 16:13 ` Michael Brand
  2010-12-02 16:59 ` Detlef Steuer
@ 2010-12-03 13:10 ` Antony
  2 siblings, 0 replies; 4+ messages in thread
From: Antony @ 2010-12-03 13:10 UTC (permalink / raw)
  To: emacs-orgmode

On 12/2/2010 2:29 AM, Antony wrote:
> I need to be able sum those numbers and say 600 somewhere (I am ok if it
> does in the same table or outside of it)
>
It seems all my issues were due to me trying to use
sum
instead of
vsum


Thanks for all the replies
-Antony

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

end of thread, other threads:[~2010-12-03 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-02 10:29 spreadsheet sum a column Antony
2010-12-02 16:13 ` Michael Brand
2010-12-02 16:59 ` Detlef Steuer
2010-12-03 13:10 ` Antony

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