Presentation is loading. Please wait.

Presentation is loading. Please wait.

情報基礎 B Lecture 5 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.

Similar presentations


Presentation on theme: "情報基礎 B Lecture 5 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information."— Presentation transcript:

1 情報基礎 B Lecture 5 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information Systems

2 SPREADSHEET 2

3 Copying Data Copy data by entering cell number (Numeric data, character data, formula) – G1=English – G2=G1 – H2=C1 – H3=E2

4 Comparing data Comparison – A15=10>3 – B15=10<3 – C15=(10*2)<3 – D15=C1>C2 – E16=C7>E2 Result is “TRUE” or “FALSE”

5 Simple Program Blanching by “TRUE” and ”FALSE” IF function – IF(criterion, action1, action2) Proceed action1 when the criterion is true, otherwise proceed action2 – =IF(logical_test, value_if_true, value_if_false) Logical test or cell number Characters with “” or numbers

6 Simple Program Operand used in logical test – A=BA is equal to B – A>BA is larger than B – A>=BA=B or A>B – A<>BA is not equal to B – A<BA is smaller than B – A<=BA=B or A<B

7 Simple Program value_if_true FALSE value_if_false =IF(logical_test, value_if_true, value_if_false) TRUE =IF(logical_test , “string”, “string”) B16 = IF (A15, “True”, “False” ) C16 = IF (C1>C2, “Correct”, “Wrong” ) =IF(logical_test , 1, 0) A16 = IF (A15, 1, 0 ) logical_test

8 Simple Program D16=IF(A1>=80, “Pass”, “Fail”) Pass FALSE TRUE Fail >=80

9 Exercise1 Simple Program : Grading Program a grading system on excel which outputs “Pass” or “Fail” – Pass: if an Score of Japanese, English, Math is more than 80 – Fail: otherwise – Add “Result” on G1 – Display “Pass” or “Fail” on G2 to G21

10 Branching A A TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE F F B B C C D D >=90 >=80 >=70 >=60

11 Branching Nesting “IF” =IF(B2>=90, “A”, ) IF(B2>=80, “B”, [others]) A A TRUE FALSE TRUE B B [others] FALSE >=90

12 Branching A A TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE F F B B C C D D >=90 >=80 >=70 >=60

13 Grading Grade – A100 > Score >= 90 – B 90 > Score >= 80 – C 80 > Score >= 70 – D 70 > Score >= 60 – F 60 > Score =IF(B2>=90, ”A”, IF(B2>=80, ”B”, IF(B2>=70, ”C”, IF(B2>=60, ”D”, “F”)))) =IF(B2>=90, ”A”, IF(B2>=80, ”B”, IF(B2>=70, ”C”, IF(B2>=60, ”D”, “F”))))

14 Exercise2 Simple Program : Grading 2 Program a grading system on excel which outputs “A”, “B”, “C”, “D” or “F” for each Subject ○ A100 > Score >= 90 ○ B 90 > Score >= 80 ○ C 80 > Score >= 70 ○ D 70 > Score >= 60 ○ F 60 > Score – Add “Japanese”, “English” and “Math” each on G1, H1 and I 1 – Display “A”, “B”, “C”, “D” or “F” on G2 to I 21

15 Count How many student got A on Japanese? =COUNTIF(range, criteria) =COUNTIF(G2:G21, “A”)

16 Exercise3 Simple Program : Counting Count numbers of student for each grade and subject JapaneseEnglishMath A645 B476 C342 D312 F445


Download ppt "情報基礎 B Lecture 5 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information."

Similar presentations


Ads by Google