Sei sulla pagina 1di 6

NCSLP Summer Institute Advanced Excel Part 1: Importing and Exporting Data

MSOffice is a suite of software, that means the different applications (Word, Access, PowerPoint, and Excel) have a common interface and can share data. Excel can import and export data to and from other applications within Office and outside Office. One wa to import data (from the we!, for example) is ! the simple cop and paste method. "ata that is imported to Excel usin# cop and paste must !e formatted. $ picall the data is stored in cell A%, even thou#h it mi#ht loo& li&e it is not. 'efore the data can !e used it must !e chan#ed so that it is actuall in the re(uired cells. Wor& throu#h the )mport data activit to #et an idea of how to import data to Excel and format it appropriatel for use. Activity 1: Importing Data, Statistical analyses, including egression

*ocate the "ata and Stor *i!rar ("AS*, pronounced +da,,le-) that is located at http.//li!stat.cmu.edu/"AS*/ "AS* is an online li!rar of datafiles and stories that illustrate the use of !asic statistics methods. A wide variet of real0world scenarios is provided. 1lic& the List All Topics !utton 2or this example we will use data on the topic of Smo&in# and 1ancer, clic& Medical, then Smoking and Cancer, and finall Smoking and Cancer datafile. $his location will provide information a!out the data and the data for per capita num!ers of ci#arettes sold ! 34 states and the "1 in %567 with the death rates per thousand population from various forms of cancer. Select the data ! hi#hli#htin#, cop and paste into cell A% in the Excel wor&sheet. Even thou#h it mi#ht appear to !e in ta!le format, it is actuall still in cell A%. 2ormat the data ! selectin# column A (clic& on the A), select Data/Text to Columns. 1hoose Delimited data t pe then clic& Next. Select the appropriate delimiters (in this case space) and chec& Treat consecutive delimiters as one, clic& Next. 2ormat the data now or later, clic& Finis . Add comments to the column headin#s 1reate scatter plots for columns 1)8 and *9:8, add a trendline with the e(uation and r0s(uared value on the chart :ame ran#es for each of the cancer t pes "etermine the correlation chart for all of the columns (use Tools/Data Anal!sis) 9se the re#ression tool, lets determine the re#ression for columns 1)8 and *9:8 a. 1lic& $ools/"ata Anal sis !. Select ;e#ression under the list of Anal sis $ools

c. )nput the ran#e for < (the dependent varia!le) and the ran#e for = (the independent varia!le) d. >ave output appear in a new wor&sheet External data can also !e o!tained throu#h usin# Data/"et #xternal Data. Excel data and ta!les can !e exported to Access (imported ! Access) and used as a data!ase. Part !: "anaging #or$spaces

)nformation created ! Excel can !e pu!lished to the we!? interactivit can !e added to the pu!lished chart information so that those who view the we!site can ma&e chan#es to the data and immediatel see the chan#es created in the chart. See http.aspire.cs.uah.edu/aspire/sc7%/excel@tutorial/exceltutorial@$O1.html 1lic& the $nteractive Spreads eets lin& for a loo& at an interactive spreadsheet pu!lished on the we!. Wor&in# with a team can !e rewardin# and challen#in#. One of the challen#es deals with &eepin# a!reast of the information modification. Excel helps with mana#in# wor&spaces throu#h comments, trac&in# chan#es, and data consolidation. Part %: Pivot &a'les A pivot ta!le is a tool that provides a different wa of loo&in# at data )t provides a d namic summar of data )t ena!les ou to create fre(uenc distri!utions and cross0ta!ulations of several different data dimensions Allows ou to displa su!totals

$he appropriate t pe of data for pivot ta!les is data!ase information. Activity !: Pivot &a'les

1reate the spreadsheet for sales information (see !elow)

What does this information showB )s this a data!ase t peB 1reate the pivot ta!le ! clic&in# "ata/Pivot$a!le and Pivot1hart ;eport 1lic& the appropriate choices on step % of the wi,ard (Microsoft Excel list or data!ase and Pivot$a!le for this example), clic& :ext Select the data to show the ran#e or t pe it in the text!ox, clic& :ext Put the pivot ta!le on a new wor&sheet, clic& 2inish :ow ou will !e a!le to create our pivot ta!le to show what ou want to show, experiment with different settin#s.

Part (: )sing t*e Control &ool'ox +it* Properties to Create a Calculation #or$s*eet 2orms and calculators can !e used to create effective wor&sheets that perform calculations when an action occurs, for example clic&in# a command !utton. 1reate the Mort#a#e 1alculation wor&sheet with the followin# tools. frame !ox with option !uttons? spinner? scroll !ar? text !ox? and command !utton. Activity %: Create a +or$ing Amorti,ation #or$s*eet +it* -rame 'ox, .ption 'uttons, Spinner, Scroll /ar, &ext /ox, La'el, and Command /utton Open Excel and recreate the wor&sheet shown on the screen Open the 1ontrol and 2orm $ool!ars Add properties for each o!Cect. o 2rame 'ox o Option !uttons inside the frame !ox o Scroll 'ar o $ext 'ox

Part 0:

o Amorti,ation command !utton is the onl one that re(uires D'A. $he code loo&s li&e this (can !e added ! dou!le clic&in# the command !utton, t pe onl one line of code !etween the !e#innin# and end) Private Sub cmdAmort_Click() Sheets("AmortSched").Activate End Sub 1reate the Amorti,ation Schedule 1isual /asic Applications 21/A3

D'A is an application that allows the Excel user to pro#ram activities and events into the wor&sheet and/or wor&!oo&. D'A uses man of the same s ntax and commands as Disual 'asic. $he followin# activit will provide a #uide for creatin# a simple weather related calculator usin# D'A. Activity (: Creating a #ind C*ill Calculator

Open a new Excel wor&!oo& Open the Control Tool%ox (Diew/$ool!ars/1ontrol $ool!ox), these are the tools that will !e used to create the calculator. "ecide how the calculator should loo& and create the #eneral +outline- of the calculator usin# !ac&#round color, !orders, formatted text, etc. 1reate the tools on the calculator usin# la!els, text !oxes, and command !uttons. 2ollowin# is a su##estion for the calculator loo&.

)nsert the properties for each o!Cect in the calculator. 9se namin# conventions for the la!els (l!l$emp for example), the text !oxes (txt$emp for example), and the command !uttons (cmd8etWind1hill for example) "ou!le clic& the 8et Wind 1hill command !utton to add the D'A code for the action that will occur when the !utton is clic&ed ! the user. When the command !utton is dou!le0clic&ed it will automaticall open the ProCect Explorer and start the code. Daria!les are declared in this manner.

"im $emp As "ou!le Ethis declares temp as a dou!le or real num!er 1omments are desi#nated with a sin#le (uote (notice in a!ove) $he followin# will +#et- the information input in the text !ox and assi#n it to the varia!le temp. $emp F txt$emp%.value Since wind chill has no meanin# when the weather is warm, create a messa#e !ox that will alert the user that the temperature needs to !e a!ove GG, as in the followin#. Ms#'ox +$here is no sense to the wind chill at this temperature. $emperature needs to !e !elow GG. 1lic& on reset and tr a#ainH$o output the +answer- to the 8et Wind 1hill text !ox t pe. txt8etWind1hill.value F $emp $o activate the ;eset !utton, dou!le clic& it and suppl the followin# code. txt$emp%.value F +txtWind%.value F +txt8etW1%.value F +$he complete code loo&s li&e the followin#.

Private Sub cmdGetWindChill_Click() 'this code oes to calculator !" #ind chill calculator $im #indChill As $ouble $im #indS%eed As $ouble $im &em% As $ouble 'et &em% ( t)t&em%!.*alue 'et #indS%eed ( t)tWind!.*alue +, &em% - .. &hen /s 0o) "&here is no sense to the #ind chill at this tem%erature. &em%erature needs to be belo# ... Click on reset and tr1 a ain2" End +, +, #indS%eed 3 4 &hen /s 0o) "Wind velocit1 must be above 4 m%h. Click on reset and tr1 a ain2" End +, 'Calculate #ind chill #indChill ( 5.56!7 8 (9.7! 8 S:r(#indS%eed) ; ..6! < 5.=. 8 #indS%eed) 8 (&em% < >!.4) ; >!.4 'out%ut #ind chill value t)tGetWC!.*alue ( ?ound(#indChill@ 5) End Sub G

Private Sub cmd?esetWC_Click() 'this code resets the #ind chill calculator (calculator !) t)t&em%!.*alue ( "" t)tWind!.*alue ( "" t)tGetWC!.*alue ( "" End Sub 1reate other calculators usin# the a!ove example. 2ormulas are provided in the pac&et and can also !e found online on the AP; Weather pa#e located at http.//aprweather.com/pa#es/calc.htm Other interestin# weather facts and formulas can !e found at. As&0A0Scientist Archive WEA$>E; http.//newton.dep.anl.#ov/as&asci/wea77.htm

Potrebbero piacerti anche