emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Spreadsheet row formula
@ 2012-01-08 15:39 RCY
  2012-01-08 15:51 ` Michael Brand
  0 siblings, 1 reply; 5+ messages in thread
From: RCY @ 2012-01-08 15:39 UTC (permalink / raw)
  To: OM

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

In the following table I am trying to implement a row formula for each cell
to be a multiple of the corresponding cell in a preceding row, but several
variations I tried do not work:

| A    | 2          | 3          | 4            |
| B    | [4, 6, 8] | [4, 6, 8] | [4, 6, 8] |
| C    | [4, 6, 8] | [4, 6, 8] | [4, 6, 8] |
| 2 A |           4 |         6  |           8 |
#+TBLFM: @2$2..@2$4=2*@1$2..@1$4::@3$2..@3$4=2*(@1$2..@1$4)



What I would like to get, without having to repeat the formula for each
cell in the row is:
|B|4|6|8|

It seems that this should be fairly simple to do. I am using the latest git
version of orgmode with emacs 24.0.50
Thanks for any suggestions.

[-- Attachment #2: Type: text/html, Size: 734 bytes --]

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

* Re: Spreadsheet row formula
  2012-01-08 15:39 Spreadsheet row formula RCY
@ 2012-01-08 15:51 ` Michael Brand
  2012-01-08 16:12   ` RCY
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Brand @ 2012-01-08 15:51 UTC (permalink / raw)
  To: RCY; +Cc: OM

Hi RCY

Do you want to do this?:

| A | 2 |  3 |  4 |
| B | 4 |  6 |  8 |
| C | 8 | 12 | 16 |
#+TBLFM: @<<$<<..@>$> = 2 * @-1


Michael

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

* Re: Spreadsheet row formula
  2012-01-08 15:51 ` Michael Brand
@ 2012-01-08 16:12   ` RCY
  2012-01-08 16:23     ` Michael Brand
  0 siblings, 1 reply; 5+ messages in thread
From: RCY @ 2012-01-08 16:12 UTC (permalink / raw)
  To: Michael Brand; +Cc: OM

[-- Attachment #1: Type: text/plain, Size: 910 bytes --]

Hi,
 Sorry not to be clearer.
I would like to implement the formula for only one row. So entering the
first row shown below and implementing the formula with only B entered in
the first column in the second row gives the rest of the second row.

 |A|2|3|4|
 |B|4|6|8|

Your suggestion almost does what I want, except that it applies the formula
to every row. I would like to apply different row formulas to succeeding
rows.
Also I was not clear about the syntax you used, does <<$<< exclude the
first column and >$> indicate up to the last column?
I tried to modify your formula to restrict it to the second row:
@2<<$<<..@2>$> = 2 * @-1
But that did not work.

Thanks.

On Sun, Jan 8, 2012 at 10:51 AM, Michael Brand
<michael.ch.brand@gmail.com>wrote:

> Hi RCY
>
> Do you want to do this?:
>
> | A | 2 |  3 |  4 |
> | B | 4 |  6 |  8 |
> | C | 8 | 12 | 16 |
> #+TBLFM: @<<$<<..@>$> = 2 * @-1
>
>
> Michael
>

[-- Attachment #2: Type: text/html, Size: 1349 bytes --]

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

* Re: Spreadsheet row formula
  2012-01-08 16:12   ` RCY
@ 2012-01-08 16:23     ` Michael Brand
  2012-01-08 16:37       ` RCY
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Brand @ 2012-01-08 16:23 UTC (permalink / raw)
  To: RCY; +Cc: OM

Hi RCY

On Sun, Jan 8, 2012 at 17:12, RCY <recif@yahoo.com> wrote:
>  Sorry not to be clearer.
> I would like to implement the formula for only one row. So entering the
> first row shown below and implementing the formula with only B entered in
> the first column in the second row gives the rest of the second row.
>
>
>  |A|2|3|4|
>  |B|4|6|8|
>
> Your suggestion almost does what I want, except that it applies the formula
> to every row. I would like to apply different row formulas to succeeding
> rows.

So you want this:

| A | 2 | 3 | 4 |
| B | 4 | 6 | 8 |
#+TBLFM: @2$<<..@2$> = 2 * @-1

> Also I was not clear about the syntax you used, does <<$<< exclude the first
> column and >$> indicate up to the last column?
> I tried to modify your formula to restrict it to the second row:
> @2<<$<<..@2>$> = 2 * @-1

@< first row
$<< second column
$> last column
@>> second last row
[...]

See also the manual here:
http://orgmode.org/manual/References.html

Michael

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

* Re: Spreadsheet row formula
  2012-01-08 16:23     ` Michael Brand
@ 2012-01-08 16:37       ` RCY
  0 siblings, 0 replies; 5+ messages in thread
From: RCY @ 2012-01-08 16:37 UTC (permalink / raw)
  To: Michael Brand; +Cc: OM

[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]

Hi,
 That does what I want. Thanks for taking the time to explain it. I should
have read the manual on relative cell references more carefully.

On Sun, Jan 8, 2012 at 11:23 AM, Michael Brand
<michael.ch.brand@gmail.com>wrote:

> Hi RCY
>
> On Sun, Jan 8, 2012 at 17:12, RCY <recif@yahoo.com> wrote:
> >  Sorry not to be clearer.
> > I would like to implement the formula for only one row. So entering the
> > first row shown below and implementing the formula with only B entered in
> > the first column in the second row gives the rest of the second row.
> >
> >
> >  |A|2|3|4|
> >  |B|4|6|8|
> >
> > Your suggestion almost does what I want, except that it applies the
> formula
> > to every row. I would like to apply different row formulas to succeeding
> > rows.
>
> So you want this:
>
> | A | 2 | 3 | 4 |
> | B | 4 | 6 | 8 |
> #+TBLFM: @2$<<..@2$> = 2 * @-1
>
> > Also I was not clear about the syntax you used, does <<$<< exclude the
> first
> > column and >$> indicate up to the last column?
> > I tried to modify your formula to restrict it to the second row:
> > @2<<$<<..@2>$> = 2 * @-1
>
> @< first row
> $<< second column
> $> last column
> @>> second last row
> [...]
>
> See also the manual here:
> http://orgmode.org/manual/References.html
>
> Michael
>

[-- Attachment #2: Type: text/html, Size: 1975 bytes --]

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

end of thread, other threads:[~2012-01-08 16:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-08 15:39 Spreadsheet row formula RCY
2012-01-08 15:51 ` Michael Brand
2012-01-08 16:12   ` RCY
2012-01-08 16:23     ` Michael Brand
2012-01-08 16:37       ` RCY

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