emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bob Newell <bobnewell@bobnewell.net>
To: emacs-orgmode@gnu.org
Subject: Distinguish between blank and zero in org-mode spreadsheet
Date: Mon, 10 Dec 2012 12:32:29 -1000	[thread overview]
Message-ID: <CAP7oW5KXKBHo46EpZ70xtM6ZAEWY=XdqNmfaVuvLYRp+E=fH0g@mail.gmail.com> (raw)

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

Can't find out about this anywhere.  My apologies if I missed something
simple or something already posted.

I want a calculation to appear in column 9 if and only if column 2 is
non-blank. If there is an explicit 0 in column 2, I want the calculation to
appear in column 9. But if column 2 is blank, I also want column 9 to be
blank.

I made it work with the following elisp example:

$9 = '(if (eq $2 "") "" (* (string-to-number @2$8) (string-to-number $1)));S

But the question is, can it be made to work with a calc formula, which
would be possibly a little more straightforward? All of the other columns
have the same requirement, and some of the formulas are quite long, so
doing many, many string-to-number functions makes things very cluttered.

The problem obviously revolves around a blank cell being interpreted as
zero. That's all well and good, and quite correct, but makes distinguishing
blank and explicit zero more difficult.

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

             reply	other threads:[~2012-12-10 22:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-10 22:32 Bob Newell [this message]
2012-12-10 22:57 ` Distinguish between blank and zero in org-mode spreadsheet Thorsten Jolitz
2012-12-11  4:50   ` Bob Newell
2012-12-11  6:10     ` Nick Dokos
2012-12-11 15:14       ` Michael Brand
2012-12-15  9:15         ` Michael Brand
2012-12-15  9:23           ` Bastien
2012-12-28 14:10             ` Michael Brand
2012-12-29 13:39               ` Bastien

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='CAP7oW5KXKBHo46EpZ70xtM6ZAEWY=XdqNmfaVuvLYRp+E=fH0g@mail.gmail.com' \
    --to=bobnewell@bobnewell.net \
    --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).