* org-table, empty cells and nan
@ 2023-06-16 16:55 Uwe Brauer
2023-06-16 18:46 ` Bruno Barbier
0 siblings, 1 reply; 3+ messages in thread
From: Uwe Brauer @ 2023-06-16 16:55 UTC (permalink / raw)
To: emacs-orgmode
Hi
I have the following table(s)
| Name | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
|-------+-------+-------+-----------+---------+-------|
| Smith | | 7.90 | | 5.81 | NP |
#+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1
However when colum 2 is not empty but colum 4 is then I obatin *nan*
| Name | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
|-------+-------+-------+-----------+---------+-------|
| Smith | 5.9 | 7.90 | | 5.81 | nan |
#+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1
A solution is to put 0 in colum 4, but for some reasons which are a
complicated to explain, I want to avoid that.
| Name | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
|-------+-------+-------+-----------+---------+-------|
| Smith | 5.9 | 7.90 | 0 | 5.81 | 5.8 |
#+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1
Any idea how to deal with the situation?
Regards
Uwe Brauer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: org-table, empty cells and nan
2023-06-16 16:55 org-table, empty cells and nan Uwe Brauer
@ 2023-06-16 18:46 ` Bruno Barbier
2023-06-16 18:49 ` Uwe Brauer
0 siblings, 1 reply; 3+ messages in thread
From: Bruno Barbier @ 2023-06-16 18:46 UTC (permalink / raw)
To: Uwe Brauer, emacs-orgmode
Hi,
Uwe Brauer <oub@mat.ucm.es> writes:
> A solution is to put 0 in colum 4, but for some reasons which are a
> complicated to explain, I want to avoid that.
>
> | Name | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
> |-------+-------+-------+-----------+---------+-------|
> | Smith | 5.9 | 7.90 | 0 | 5.81 | 5.8 |
> #+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1
>
>
>
> Any idea how to deal with the situation?
Maybe this formula?
#+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+ if("$4" == "nan", 0, $4)); E f-1
Regards,
Bruno
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: org-table, empty cells and nan
2023-06-16 18:46 ` Bruno Barbier
@ 2023-06-16 18:49 ` Uwe Brauer
0 siblings, 0 replies; 3+ messages in thread
From: Uwe Brauer @ 2023-06-16 18:49 UTC (permalink / raw)
To: Bruno Barbier; +Cc: Uwe Brauer, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]
>>> "BB" == Bruno Barbier <brubar.cs@gmail.com> writes:
> Hi,
> Uwe Brauer <oub@mat.ucm.es> writes:
>> A solution is to put 0 in colum 4, but for some reasons which are a
>> complicated to explain, I want to avoid that.
>>
>> | Name | Exam1 | Exam2 | Exercises | Ex1_Ex2 | Total |
>> |-------+-------+-------+-----------+---------+-------|
>> | Smith | 5.9 | 7.90 | 0 | 5.81 | 5.8 |
>> #+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+$4); E f-1
>>
>>
>>
>> Any idea how to deal with the situation?
> Maybe this formula?
> #+TBLFM: $6=if("$2" == "nan", string("NP"), 0.65*$2+0.25*$3+ if("$4" == "nan", 0, $4)); E f-1
Ha nested if, ah, of course
Thanks very very much
--
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 NATO membership of the Ukraine.
I support the EU membership of the Ukraine.
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-16 18:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16 16:55 org-table, empty cells and nan Uwe Brauer
2023-06-16 18:46 ` Bruno Barbier
2023-06-16 18:49 ` 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).