emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* noob question : In a table , how to update a formula when inserting a new line
@ 2010-05-08  2:21 Matt Chastagnier
  2010-05-08  2:56 ` Nick Dokos
  2010-05-08  3:48 ` w t
  0 siblings, 2 replies; 4+ messages in thread
From: Matt Chastagnier @ 2010-05-08  2:21 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1090 bytes --]

Hi,

I've just started with org-mode and have done several tutorials. But I'm
stuck with this problem for 3 hours :


I have :

| item    | quantity |
|---------+----------|
| laptop  |        4 |
| desktop |        7 |
|---------+----------|
| Total   |       11 |

#+TBLFM: @4$2=vsum(@I..@II)

I insert a new line [because I will want to add a new item] (M-S down) and
update the table (C-u C-c C-c) :

| item    | quantity |
|---------+----------|
| laptop  |        4 |
| desktop |        7 |
|         |       11 |
|---------+----------|
| Total   |       11 |

#+TBLFM: @4$2=vsum(@I..@II)

but my formula isn't updated automatically so the wrong field is updated. I
would like the formula to become @5$2 instead of @4$2 automatically.
I've searched during 2 hours with google but found nothing :/ ... Is it
possible to do it? Cause It's very annoying to update the formula "by hand"
(sorry for my english).


and just a big thank you for this very powerful extension of emacs ^^.

Thank you in advance for having read,
hoping for an answer if you have a bit time,

Salutation

Matt C

[-- Attachment #1.2: Type: text/html, Size: 1773 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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: noob question : In a table , how to update a formula when inserting a new line
  2010-05-08  2:21 noob question : In a table , how to update a formula when inserting a new line Matt Chastagnier
@ 2010-05-08  2:56 ` Nick Dokos
  2010-05-08  3:48 ` w t
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2010-05-08  2:56 UTC (permalink / raw)
  To: Matt Chastagnier; +Cc: nicholas.dokos, emacs-orgmode

Matt Chastagnier <workandroll@gmail.com> wrote:

> I've just started with org-mode and have done several tutorials. But I'm
> stuck with this problem for 3 hours :
> 
> 
> I have :
> 
> | item    | quantity |
> |---------+----------|
> | laptop  |        4 |
> | desktop |        7 |
> |---------+----------|
> | Total   |       11 |
> 
> #+TBLFM: @4$2=vsum(@I..@II)
> 
> I insert a new line [because I will want to add a new item] (M-S down) and
> update the table (C-u C-c C-c) :
> 
> | item    | quantity |
> |---------+----------|
> | laptop  |        4 |
> | desktop |        7 |
> |         |       11 |
> |---------+----------|
> | Total   |       11 |
> 
> #+TBLFM: @4$2=vsum(@I..@II)
> 
> but my formula isn't updated automatically so the wrong field is updated. I
> would like the formula to become @5$2 instead of @4$2 automatically.
> I've searched during 2 hours with google but found nothing :/ ... Is it
> possible to do it? Cause It's very annoying to update the formula "by hand"
> (sorry for my english).
> 

You looked in the wrong place :-) If you look in section 3.5.1,
"References", in the Org manual, you'll find

,----
|    As a special case, references like `$LR5' and `$LR12' can be used to
| refer in a stable way to the 5th and 12th field in the last row of the
| table.
`----


So make your formula

#+TBLFM: $LR2=vsum(@I..@II)

HTH,
Nick

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

* Re: noob question : In a table , how to update a formula when inserting a new line
  2010-05-08  2:21 noob question : In a table , how to update a formula when inserting a new line Matt Chastagnier
  2010-05-08  2:56 ` Nick Dokos
@ 2010-05-08  3:48 ` w t
  2010-05-08 16:06   ` Matt Chastagnier
  1 sibling, 1 reply; 4+ messages in thread
From: w t @ 2010-05-08  3:48 UTC (permalink / raw)
  To: Matt Chastagnier; +Cc: emacs-orgmode

On Fri, May 7, 2010 at 7:21 PM, Matt Chastagnier <workandroll@gmail.com> wrote:
> Hi,
>
> I've just started with org-mode and have done several tutorials. But I'm
> stuck with this problem for 3 hours :
>
>
> I have :
>
> | item    | quantity |
> |---------+----------|
> | laptop  |        4 |
> | desktop |        7 |
> |---------+----------|
> | Total   |       11 |
>
> #+TBLFM: @4$2=vsum(@I..@II)
>
> I insert a new line [because I will want to add a new item] (M-S down) and
> update the table (C-u C-c C-c) :
>
> | item    | quantity |
> |---------+----------|
> | laptop  |        4 |
> | desktop |        7 |
> |         |       11 |
> |---------+----------|
> | Total   |       11 |
>
> #+TBLFM: @4$2=vsum(@I..@II)
>
> but my formula isn't updated automatically so the wrong field is updated. I
> would like the formula to become @5$2 instead of @4$2 automatically.

Before editing the table make sure there is no blank line between the
table and the line "#+TBLFM: @4$2=vsum(@I..@II)". Then use the
M-S-<down> command.

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

* Re: noob question : In a table , how to update a formula when inserting a new line
  2010-05-08  3:48 ` w t
@ 2010-05-08 16:06   ` Matt Chastagnier
  0 siblings, 0 replies; 4+ messages in thread
From: Matt Chastagnier @ 2010-05-08 16:06 UTC (permalink / raw)
  To: w t; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1336 bytes --]

That's it !!! Big thank you w t ... it was due to that blank line between
table and the line "#+TBLFM"
Thank you Nick Docos too for your reply :)

cheers

Matt

On Sat, May 8, 2010 at 5:48 AM, w t <1218121@gmail.com> wrote:

> On Fri, May 7, 2010 at 7:21 PM, Matt Chastagnier <workandroll@gmail.com>
> wrote:
> > Hi,
> >
> > I've just started with org-mode and have done several tutorials. But I'm
> > stuck with this problem for 3 hours :
> >
> >
> > I have :
> >
> > | item    | quantity |
> > |---------+----------|
> > | laptop  |        4 |
> > | desktop |        7 |
> > |---------+----------|
> > | Total   |       11 |
> >
> > #+TBLFM: @4$2=vsum(@I..@II)
> >
> > I insert a new line [because I will want to add a new item] (M-S down)
> and
> > update the table (C-u C-c C-c) :
> >
> > | item    | quantity |
> > |---------+----------|
> > | laptop  |        4 |
> > | desktop |        7 |
> > |         |       11 |
> > |---------+----------|
> > | Total   |       11 |
> >
> > #+TBLFM: @4$2=vsum(@I..@II)
> >
> > but my formula isn't updated automatically so the wrong field is updated.
> I
> > would like the formula to become @5$2 instead of @4$2 automatically.
>
> Before editing the table make sure there is no blank line between the
> table and the line "#+TBLFM: @4$2=vsum(@I..@II)". Then use the
> M-S-<down> command.
>

[-- Attachment #1.2: Type: text/html, Size: 1990 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

end of thread, other threads:[~2010-05-08 16:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-08  2:21 noob question : In a table , how to update a formula when inserting a new line Matt Chastagnier
2010-05-08  2:56 ` Nick Dokos
2010-05-08  3:48 ` w t
2010-05-08 16:06   ` Matt Chastagnier

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