From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Newell Subject: Distinguish between blank and zero in org-mode spreadsheet Date: Mon, 10 Dec 2012 12:32:29 -1000 Message-ID: Reply-To: bobnewell@bobnewell.net Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d042f96fcf63f6e04d0872369 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiBtr-0001tQ-QL for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 17:32:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiBtn-0008WE-Ep for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 17:32:35 -0500 Received: from mail-la0-f41.google.com ([209.85.215.41]:60675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiBtn-0008Vu-7Y for emacs-orgmode@gnu.org; Mon, 10 Dec 2012 17:32:31 -0500 Received: by mail-la0-f41.google.com with SMTP id m15so2751306lah.0 for ; Mon, 10 Dec 2012 14:32:29 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --f46d042f96fcf63f6e04d0872369 Content-Type: text/plain; charset=ISO-8859-1 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. --f46d042f96fcf63f6e04d0872369 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Can't find out about this anywhere. =A0My apologies if I missed somethi= ng simple or something already posted.

I want a calculat= ion 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. B= ut if column 2 is blank, I also want column 9 to be blank.

I made it work with the following elisp example:

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

But the question is, can it be made to work with a calc formula, which woul= d 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 man= y, many string-to-number functions makes things very cluttered.

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