## Friday, September 29, 2006

### OpenOffice boolean if function

Someone asked me how they would use boolean statements in OpenOffice's Spreadsheet application, Calc.

In my previous example showing how to calculate the number of days between 2 dates I set cells A1 and B1 to be dates and set C1 to be a formula that used the "DAYS" function to calculate the number of days between the two dates.

If you wanted to only output the calculation if A1 and B1 were greater than zero and output 0 otherwise you could use the "IF" and "AND" functions as follows:

=IF(AND(A1>0;B1>0);DAYS(A1;B1);0)

The "IF" function takes three parameters:

1st - a boolean test, in this case "AND(A1>0;B1>0)"
2nd - a value to output if the test evaluates to TRUE, in this case "DAYS(A1;B1)"
3rd - a value to output if the test evaluates to FALSE, in this case "0"

Spreadsheets are really quite versatile. It's surprising just how much they can do.

### OpenOffice Calculate Days Between

Someone asked me how they could calculate the number of days between two dates using OpenOffice's Spreadsheet application, Calc.

The answer is to use the "DAYS" function.

Type a date in cell A1, set the format of the cell to be a date, type another date in cell B1, set that cells format to also be a date, then enter the following in cell C1:

=DAYS(A1;B1)

Cell C1 will now contain a number signifying the number of days between the two dates.

## Thursday, September 28, 2006

### Fast Velcro Costume Change

Someone just asked me how do performers make a clothes change so quickly on stage?

All those buttons are just for show, underneath it's just Velcro.

1. What year will the cyclical cicada occur here in Illinois?

2. Do both the annual and the cyclical occur at the same time?

3. If the cyclical cicada egg takes 13/17 years to become a larva and
emerge, how long is the annual underground? Is it a year?

1. Broods III, XIII, XIX, and XXIII will emerge in 2014, 2007, 2011, and 2015 respectively.

2. The annual and periodic cicadas may coexist at the same time.

3. The annual cicada exists underground between 1 and 7 years.