prev | Version 1014 (Mon Nov 27 20:46:07 2006) | next |
Gnumeric
insteadFigure 21.1: Empty Spreadsheet
A1
or C4
Figure 21.2: Raw Scores
Figure 21.3: Scores After Formatting Titles
(0.3*C2)+(0.7*D2)
C2
and D2
are references to other cellsFigure 21.4: Scores With A Formula
Figure 21.5: Copying Formulas
(0.01*A1+0.01*A2+...+0.01*A100)
AVERAGE(C2:C4)
MAX
below average, along with a labelMIN
Figure 21.6: Minimum, Average, and Maximum Scores
Function | Purpose |
---|---|
AND(e1,e2,...) | True if all expressions are true; false otherwise |
AVERAGE(values) | Return the average of the given values (which may be a range) |
DATE(year,month,day) | Return the number of days since January 1, 1900 for the given date |
INDEX(array,row,col) | Return the section of an array indexed by row and column indices |
LOOKUP(value,lookup_vector,result_vector) | Find a value in a lookup vector, and return the corresponding entry from the result vector |
NOT(e) | True if the expression is 0; false otherwise |
OR(e1,e2,...) | True if any expression is true; false otherwise |
RAND() | Return a random value between 0 and 1 |
REPLACE(old,start,num,new) | Replace part of a string |
ROUND(number) | Round off a number |
SIN(e) | Return the sine of an expression |
TODAY() | Return the number of days since January 1, 1900 for today |
Table 21.1: Gnumeric Functions |
Figure 21.7: Dependencies Between Cells
IF(condition,true_value,false_value)
IF(E2>75,"success","failure")
in cell F2Figure 21.8: Conditionals
IF(E2<70,"Failure",IF(E2<80,"Marginal",IF(E2<86,"Good","Excellent")))
LOOKUP(value,lookup_vector,result_vector)
value
is a single celllookup_vector
is part of a single row or columnlookup_vector
must be sorted in order for this to workLOOKUP(E2,B9:E9,B10:E10)
in cell F2Figure 21.9: Looking Up Results
#N/A
, meaning “not valid”Figure 21.10: Lookup Failure
$B$9
means cell B9 even when the formula is copied, rows and columns are inserted or deleted, etc.LOOKUP(E2,$B$9:$E$9,$B$10:$E$10)
Figure 21.11: Absolute References in Formulas
solarsystem.csv
Name,Position,Orbits,Distance,Period,Inclination,Eccentricity ,,,x1000km,days,degrees,degrees Sun,-,-,-,-,-,- Mercury,1,Sun,57910,87.97,7.00,0.21 Venus,2,Sun,108200,224.70,3.39,0.01 Earth,3,Sun,149600,365.26,0.00,0.02 Mars,4,Sun,227940,686.98,1.85,0.09 Jupiter,5,Sun,778330,4332.71,1.31,0.05 Saturn,6,Sun,1429400,10759.50,2.49,0.06 Uranus,7,Sun,2870990,30685.00,0.77,0.05
Figure 21.12: Scrolling the Solar System
Figure 21.13: Basic Chart
log(D4)
, then copy, select I5:I78, and pastelog(E4)
, copy, and paste into #NUM!
Figure 21.14: Error Creating Log-Log Plot
log(abs(E4))
Figure 21.15: Log-Log Plot of Distances and Periods
Exercise 21.1:
Spreadsheets use conditional expressions, rather than conditional statements. C/C++, Java, and Python also support conditional expressions. How are they written? When should you use them? When shouldn't you?
Exercise 21.2:
$B$9
is an absolute reference to the cell B9. What does
the expression $B9
refer to? What about B$9
?
When would you use expressions like these?
prev | Copyright © 2005-06 Python Software Foundation. | next |