You are on page 1of 38

Introduction to Compute

r Languages
02_Getting started with Excel
Why Excel?
• While number crunching: Create budget, tabulate data, analyze surve
y results, and perform any type of financial analysis
• Creating charts (figures)
• Organizing list: Use the row-and-column layout to store lists efficiency
• Text manipulation: Clean up and standardize text-based data
• Accessing other data: Import data from a wide variety of sources
• Creating graphical dashboards: Summarize a large amount of business
information in a concise format
• Creating graphics and diagrams: Shapes and SmartArt
• Automating complex tasks: Excel’s macro
快速存取工具列
Ribbon ( 功能表 )

column

row

row-and-column layout
Moving around a worksheet
• Rows (numbered 1 through 1048576)
• Columns (labeled A through XFD)
• The intersection of a row and a column is a single cell ( 儲存格 )
• Active cell
Using Ribbon
• Toggle the visibility of Ribbon: Ctrl
+F1
• Ribbon tabs & Quick assess tool b
• Customize the Ribbon: 檔案選
項自定功能區

Try to customize the quick assess tool bar ( 快速存取工具列 )


Assessing the Ribbon by using keyboard
• Press the Alt key to show the pop-up keytips
• You don’t need to hold down the Alt key while you type the keytip lett
ers
• Example: Change font color: Alt  H  FC

Try assessing the Ribbon by using your keyboard


Shortcut menus
• Right-click a cell
• Box above the shortcut menu: the mini toolbar
Getting started on your worksheet
• Entering a data into a cell: active the cell, type the data, and then pres
s Enter (or a Navigation key)
• Filling the month with autofill
Fill handle

Try using the fill handle to autofill your data


Exploring data type
• A numeric value
• Also can be dates (Feb-26-2014) or Times (3:24 a.m.)
• Excel’s numbers are precise up to 15 digits
• Text
• A formula
• Starts with “=“
• Chart, diagram, pictures, buttons, and other objects are on the works
heet’s draw layer (not within the cell)

Try to enter your credit card number in a cell


Entering dates and times

• Date settings: Type “Feb 1, 2013” can be interpreted as date (2013/2/


1 , 1-Feb-2013), but not for “1 Feb, 2013”

• Try entering a formula to calculate the number of days


between two dates
• Try autofilling a series of dates in 2-day interval
Some handy data-entry techniques
• Selecting a range of cells before ent
ering data
• Using Ctrl+Enter to place informatio
n into multiple cells simultaneously
(same data)
• AutoComplete
• Entering fraction
• 3 and 6/7  3 blank 6/7
• 1/8  0 blank 1/8
Some handy data-entry techniques
• AutoCorrect ( 自動校正 )
• You can customize your AutoCorrect e
ntries
Number formatting
Customizing quick assess toolbar
• Add a new command to your quick assess toolbar
Entering the current time and date
• Current date: Ctrl + ;
• Current time: Ctrl + Shift + ;
Number formatting ( 儲存格格式數值 )

Right click the active cell


Example: adding your own number format
s
• Try to customize these number formats
• Type “8888”  $8,888.000
• Time: 19 時 47 分
• UK$6,666
Importing data from file
• Importing from file
• Open dialog box
• Spreadsheet file format
• Binary file
• 二進位檔: only machine know
• ASCII file (text file)
• ASCII file is defined as a file that c
onsists of ASCII characters. It‘s us
ually created by using a text edito
r, such as Notepad ( 筆記本 )
• xls, xlsx, …  Binary file
• txt, csv, …  Text file
Obtaining Water Quality data from EPA
• EPA website (www.epa.gov.tw)
 水質監測
• Example
• 鹽水溪進階資料查詢
• 鹽水溪橋、五年
• 查詢
• 資料下載
• ***.csv
Get external data
• 資料從文字檔選取 csv
• 匯入字串精靈
• 以符號分隔
• csv
• 以寬度分隔
• 我的資料有標題?
• 儲存格格式:一般
• 匯入資料 (Import data dialog box)
• 內容
• 取消儲存查詢定義 (save the query definition)
• 不儲存到資料模型
• 結果
Practice: When we need to save the query
definition?
Navigating with your keyboard
Navigating within the data range

Ctrl+

Starts from B2, try: Ctrl+; Ctrl+; Ctrl+; Ctrl+


Starts from B2, try: Ctrl+Shift+; Ctrl+Shift+ ; Ctrl+Shift+; Ctrl+Shift+
Starts from B2, try: Ctrl+Shift+, hold Ctrl+Shift, 
Controlling the worksheet view
• Zooming
• Comparing Worksheets: 檢視開新視窗 並排顯示
Splitting the worksheet window into pa
nes
• 檢視分割
• If cell pointer is in Row 1 and Colum A  2-pane
• Other cell  4-pane
Keeping the title in view
• 檢視凍結窗格
Cells and Ranges
• Selecting ranges (B5:C8)
• Ctrl + A  select all
• Selecting non-contiguous cells (+ Crtl)
資料篩選
• 資料篩選
• Sort the data
• View conditional data
• Select visible values
• Alt + ;
Removing duplicate rows
• 資料移除重複
• “Removing duplicate rows” is very usef
ul when data is compiled from differen
t sources

Practice: How “removing duplicate rows” works


when working on same data displayed in different
formats?
Splitting text
1 John Apr 2007
2 Mary Mar 2008
• 資料剖析 3 Tom Apr 2009

• Copy text data on Excel


• Splitting text
• 資料資料剖析
• 以符號分隔
• 空白
Example
• Using a form for data entry
Flash fill
• Use pattern recognition to extract
data
• Cursor on C3
• 資料快速填入 Flash fill

• The “splitting text” can’t do it bec


ause the space delimiters aren’t c
onsistent
Time to obtain some data by yourself
• Obtain data from internet. Using Excel to import the data you have do
wnloaded

• 全國各縣市人口統計資料
• 河川水質資料
• 水庫水位與蓄水量資料
• 空氣品質資料
• 歷次總統選舉縣市投票統計資料
• Others
Insert function
Some basic functions
• 平均值
• 排序
• 絕對值
• 天數
• 中位數
Basic Function
• Average
• Median

=average(C3:G3)

=median(C3:G3)
Use of “ Autofill without $ Autofill with $
$”
Exercise 1: Trend slope estimator
• We use the example where we have 60 observations of ammonia nitr
ogen concentrations from five years of monthly sampling at a river sit
e
• Denote the concentration in any month i and year j as Cij. The procedu
re is as follows:
• Select a particular month i and compute all possible annual slopes between y
ears for that month. There are 10 of these:
ci 2  ci1 ci 3  ci1 ci 4  ci1 ci 5  ci1 ci 3  ci 2 ci 4  ci 2 ci 5  ci 2 ci 4  ci 3 ci 5  ci 3 ci 5  ci 4
, , , , , , , , ,
1 2 3 4 1 2 3 1 2 1
Exercise 1 (cont.)
• Repeat this procedure for all months (i.e., for i = 1, 2, . . . ,12) for each of t
he five years, giving 120 slopes.
• Rank these slopes and take the median ( 中位數 ) as the trend slope esti
mate.
• Median: In this case, it is the average ( 平均值 ) value of the 60th and 61st slopes.
10.0 NH3-N
9.0
8.0
7.0
6.0
5.0
4.0
3.0
2.0
1.0
0.0
1-Sep 14-Jan 28-May 10-Oct 22-Feb 6-Jul

You might also like