emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: Chris Henderson <henders254@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Fwd: Re: Adding items in table
Date: Thu, 02 Oct 2014 11:59:07 +0200	[thread overview]
Message-ID: <m2ppeassgk.fsf@christianmoe.com> (raw)
In-Reply-To: <CAFrmxDc=7+xFiGsizNTpmYsyXYCtZviHH-vWyf8MdhmtQuWY5g@mail.gmail.com>


It looks like what you actually want to do is add up the numbers in the
rows of column 3 -- from row 2 to 3 in your example. Your original
formula added up columns (prefixed with `$'). Rows are prefixed with `@'.

You need to get rid of the dollar signs in your cells to let Org know
they contain numbers.

This would work:

| Item  | Model | price ($) |
| x     | v     |    323.98 |
| y     | x     |    184.45 |
| Total |       |    508.43 |
#+TBLFM: @4$3=vsum(@2..@3)

I usually prefer to add horizontal lines and make the formula relative
to them:

| Item  | Model | price ($) |
|-------+-------+-----------|
| x     | v     |    323.98 |
| y     | x     |    184.45 |
|-------+-------+-----------|
| Total |       |    508.43 |
#+TBLFM: @4$3=vsum(@I..@II)

Hope this helps,

Christian


Chris Henderson writes:

> Here's an example of the table (hope the line breaks are ok)
>
> |Item | Model | price |
> | x     | v          | $323.98
> | y     | x          | $184.45|
> | Total |           | ??          |
>
> On Thu, Oct 2, 2014 at 7:01 PM, Christian Moe <mail@christianmoe.com> wrote:
>
>>
>> Christian Moe writes:
>>
>> You probably don't really want to replace the contents of column 3 ($3)
>> with a sum of columns including column 3 ($2..$9)?
>>
>> To get useful help you'll need to provide the table, or a minimal
>> example of a table with the same structure.
>>
>> Yours,
>> Christian
>>
>> >
>> > Chris Henderson writes:
>> >
>> >> I have a table and would like to add all costs (in $) in column 3 as a
>> >> total. Wondering how do I do that. I have done "=vsum($2..$9)" - but
>> this
>> >> hangs my org file and I have to kill it with the -9 switch.
>> >>
>> >> Thanks.
>>
>>
>>

      reply	other threads:[~2014-10-02  9:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02  8:13 Adding items in table Chris Henderson
2014-10-02  8:53 ` Christian Moe
2014-10-02  9:01   ` Fwd: " Christian Moe
2014-10-02  9:42     ` Chris Henderson
2014-10-02  9:59       ` Christian Moe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ppeassgk.fsf@christianmoe.com \
    --to=mail@christianmoe.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=henders254@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).