emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: How to exclude colum titles from calculations
Date: Thu, 09 Mar 2023 11:45:48 +0100	[thread overview]
Message-ID: <878rg6nqxv.fsf@mat.ucm.es> (raw)


Hi 

Please take this example: 

|-------+-----------+-------------+-----------+----------|
|       | Account 1 | 1/4 part of | Account 2 |      1/4 |
|-------+-----------+-------------+-----------+----------|
| Item1 |    224999 |             |    224999 |          |
| Item2 |    269403 |             |    269403 |          |
| Item3 |           |             |           |          |
| Item4 |           |             |           |          |
| Item5 |     10300 |     2575.00 |           |          |
#+TBLFM: $3=if(typeof(0.25*$2) == 12, string(""),0.25*$2); E f-2::$5=if(typeof(0.25*$4) == 12, string(""),0.25*$4); E f-2

C-c C-c 

Leads to the expected 


|-------+-----------+-------------+-----------+----------|
|       | Account 1 | 1/4 part of | Account 2 |      1/4 |
|-------+-----------+-------------+-----------+----------|
| Item1 |    224999 |    56249.75 |    224999 | 56249.75 |
| Item2 |    269403 |    67350.75 |    269403 | 67350.75 |
| Item3 |           |             |           |          |
| Item4 |           |             |           |          |
| Item5 |     10300 |     2575.00 |           |          |
#+TBLFM: $3=if(typeof(0.25*$2) == 12, string(""),0.25*$2); E f-2::$5=if(typeof(0.25*$4) == 12, string(""),0.25*$4); E f-2


However when I have one line on top of the table 


|       |      What |             | This      |     |
|-------+-----------+-------------+-----------+-----|
|       | Account 1 | 1/4 part of | Account 2 | 1/4 |
|-------+-----------+-------------+-----------+-----|
| Item1 |    224999 |             |    224999 |     |
| Item2 |    269403 |             |    269403 |     |
| Item3 |           |             |           |     |
| Item4 |           |             |           |     |
| Item5 |     10300 |     2575.00 |           |     |
#+TBLFM: $3=if(typeof(0.25*$2) == 12, string(""),0.25*$2); E f-2::$5=if(typeof(0.25*$4) == 12, string(""),0.25*$4); E f-2

Then C-u C-u C-c C-c leads to 


|       |      What |                              |      This |                              |
|-------+-----------+------------------------------+-----------+------------------------------|
|       | Account 1 | mul = 12 ?  : 0.25 Account 1 | Account 2 | mul = 12 ?  : 0.25 Account 2 |
|-------+-----------+------------------------------+-----------+------------------------------|
| Item1 |    224999 |                     56249.75 |    224999 |                     56249.75 |
| Item2 |    269403 |                     67350.75 |    269403 |                     67350.75 |
| Item3 |           |                              |           |                              |
| Item4 |           |                              |           |                              |
| Item5 |     10300 |                      2575.00 |           |                              |
#+TBLFM: $3=if(typeof(0.25*$2) == 12, string(""),0.25*$2); E f-2::$5=if(typeof(0.25*$4) == 12, string(""),0.25*$4); E f-2

Which is terrible.

Any idea how to avoid this?

Thanks and regards

Uwe Brauer 


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/



             reply	other threads:[~2023-03-09 10:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 10:45 Uwe Brauer [this message]
2023-03-09 12:28 ` How to exclude colum titles from calculations Fraga, Eric
2023-03-09 13:58   ` Uwe Brauer

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=878rg6nqxv.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \
    /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).