[LON-CAPA-users] conditions in spreadsheet?
Gerd Kortemeyer
lon-capa-users@mail.lon-capa.org
Wed, 26 Jun 2002 21:23:00 -0400
This is a multi-part message in MIME format.
--------------E6131EB9640767A2DCBCF936
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Ray,
While cells can contain any Perl code (loops, ifs, unless's, etc), a very easy
way to implement conditional return values is the "?" operator in Perl:
(condition?return if true:return if false)
For example,
(A5<5?3*A6:A7)
will return three time A6 if A5 is smaller than 5, and A7 otherwise.
To get conditions based on time, use the &EXT function, like in
&EXT('system.time')
which returns GMT of the server clock.
There is a danger to time-dependent calculations: the whole spreadsheet caching
is messed up, since sheets basically are stale the moment you calculate them.
To make sure you get up-to-date information, you have to "Completely
Recalculate Sheet" every time that something else in that condition changes. In
case of weekly deadlines, all sheets are stale weekly.
- Gerd.
Ray Batchelor wrote:
> Here is a question I have that perhaps others might need an answer to also.
> I haven't found an item on this in the FAQs...
>
> I want to specify a condition inside a spreadsheet cell so that what it
> outputs depends upon whether the duedate is past.
>
> Any tips on what the correct syntax might be?
>
> Thanks
> Ray
> _______________________________________________
> LON-CAPA-users mailing list
> LON-CAPA-users@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
--------------E6131EB9640767A2DCBCF936
Content-Type: text/x-vcard; charset=us-ascii;
name="korte.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Gerd Kortemeyer
Content-Disposition: attachment;
filename="korte.vcf"
begin:vcard
n:Kortemeyer;Gerd
tel;fax:(517) 432-2175
tel;work:(517) 432-5468
x-mozilla-html:FALSE
url:http://www.lite.msu.edu/kortemeyer/
org:LITE Lab;DSME MSU
version:2.1
email;internet:korte@lite.msu.edu
title:Instructional Technology Specialist
adr;quoted-printable:;;123 North Kedzie Labs=0D=0AMichigan State University;East Lansing;MI;48824;USA
fn:Gerd Kortemeyer
end:vcard
--------------E6131EB9640767A2DCBCF936--