emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to exclude colum titles from calculations
@ 2023-03-09 10:45 Uwe Brauer
  2023-03-09 12:28 ` Fraga, Eric
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Brauer @ 2023-03-09 10:45 UTC (permalink / raw)
  To: emacs-orgmode


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/



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

end of thread, other threads:[~2023-03-09 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 10:45 How to exclude colum titles from calculations Uwe Brauer
2023-03-09 12:28 ` Fraga, Eric
2023-03-09 13:58   ` Uwe Brauer

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