intermacs form download excel tutorial pivot tables, graphic tools, macros by: devin koehl

42
Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Upload: daniela-newman

Post on 19-Jan-2016

230 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Intermacs Form Download Excel TutorialPivot Tables, Graphic Tools, MacrosBy: Devin Koehl

Page 2: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Congratulations!

• You’ve chosen to download the Intermacs data for your site.

• This tutorial will teach you many features within Excel that can help you manipulate, display, and perform mathematical calculations on your data

• Each slide will have instructions and screen shots to guide you every step of the way.

Page 3: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Filtering your data

• Upon downloading your data, it will populate in Excel. Below is an example of what you should see.

• We will create table headers for each column.• First, highlight the entire row of column headers as seen

below. Clicking to the left of row 5 will highlight all rows

Page 4: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Filtering your data

• Next, click on the “data” tab

• Then, click “Filter”

Page 5: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Filtering your data• This is how your data should appear:

• These filters give you the power to control what you see.

• If you only want to see patients whose device was not functioning normally when they died, you could click the drop down box on “Device Function Normal” and unselect “yes”.

Page 6: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Short cut keys for filtering

• Click on the first column. Ctrl+Shift+L – Applies filters to all columns within your data

Page 7: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Tables

• Another great feature of Excel is the ability to create pivot tables. A pivot table is a data summarization tool. It allows you to create cross tabulations by dragging and dropping your fields of choice.

Page 8: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Tables

• The first step is selecting the very first column in your spreadsheet. Once you have selected this, go to the “insert” tab. Click on “Pivot Table”

Page 9: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Tables• Once you click “PivotTable”, the following screen should appear:

• This box is asking you to select the table or range. You will see that the range is already selected for you. Click “Ok”.

Page 10: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Tables

Page 11: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Tables• From this screen, you have control over what variables you would like displayed.

Under “PivotTable fields” you will see a listing of all variables contained in this form. Now you are free to pick and choose what variables you would like to see. For example, if we wanted to see a count of Cause of Death from our site, we would specify we want Primary Cause of Death as a row (we want each cause of death displayed horizontally). Also, since we want to see how many Primary Cause of Deaths there are, we will add it to the “Values” box.

Page 12: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Tables• Now we will see a total of how many deaths there

are at our site:

*Please note counts are blacked out to not show specific site numbers

Page 13: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Table Options

• There are many options for these pivot tables. You should play around with this and see how adding certain variables to each box changes your graph. You can build a table exactly to your specifications!

Page 14: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Graphs

• Perhaps we do not want to see a table of our data, but a graphical representation. This is great for presentations or a more “eye-catching” approach.

• There are many ways to approach this, but let us just begin from our current point.

Page 15: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Graphs

• Select your graph type

Page 16: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Graph Example: Device Type by Implant Year

• We will be looking at the Implant form since we will need Implant Date and Device Type

• The first step will be to create another column that has the Implant Year. Currently, we are given the Implant Date which contains the month and day. We will extract the year from this.

• Click on “Implant Date” in column H. Right click and select “Insert – Entire Column”

Page 17: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Graph Example – Device Type by Implant Year

• Now we will have a blank column to the left of Implant Date• Be sure to label this column “Implant Year” or a name of your

choosing• Clicking on cell G7 (or the appropriate cell you choose) on our

new column, we will utilize the formula bar . • Type the following:

Page 18: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Graph Example – Device Type by Implant Year

• After entering this formula, paste it all the way. This will give you just the year of your Implant Date! Now we can use this to set-up our Pivot Table. Please see the options below.

Page 19: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Device Type by Implant Year Example

*Please note vertical axis is blacked out to not show specific site numbers

Page 20: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Graph: Example – Bar Chart

Page 21: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Pivot Chart: Example – Pie Chart

Page 22: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually• Perhaps you would like to have all your form downloads in the

same spreadsheet. First and foremost, all of your form download spreadsheets must be open on your desktop. Select one at random (I have chosen Death) to begin. At the bottom of your selected spreadsheet, right click on the tab containing the form name.

Page 23: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually

• From here, you will see the menu below. Select “Move or Copy”

Page 24: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually• Upon clicking this, the following screen will appear:

Page 25: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually

• This shows you the current sheet you have open. Notice the drop down box under “To book:”. Click this arrow:

Page 26: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually• This is where it is important you have all of your form

download spreadsheets you wish to combine open on your desktop. This list will show you all open Excel documents.

Page 27: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually• This screen is asking you to select WHERE you would like to move the

current spreadsheet. Now I am free to select (out of all my open spreadsheets) where I would like to place the current spreadsheet (in my example, the Death form). Notice I have selected “AE Reminder” as the spreadsheet I wish to combine with the Death Form.

Page 28: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually

• If I click “ok”, both the AE Reminder Form and Death form will now be one workbook.

Page 29: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually• Now I will take Death and AE Reminder, and combine them with another

spreadsheet. Hold CTRL and select both tabs (In my example, Death and AE Reminder) in your new spreadsheet. Notice they will turn white. This indicates they are both highlighted. Now we will repeat the same process, except with the two newly highlighted spreadsheets.

Page 30: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually• Now I will click the drop down arrow. Notice I am selecting

“AE Neuro” this time as the form I want to combine with AE Reminder and Death.

Page 31: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually

• Once I click “ok”, I will now have a spreadsheet containing AE Neuro, AE Reminder, and Death.

Page 32: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Consolidating Worksheets Manually

• To combine each of your downloads, you would repeat this process of highlighting each tab and selecting a new worksheet to combine it with.

• Whew, that can be time consuming! This is where the next part of the tutorial comes in to save the day.

Page 33: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Advanced Excel: VBA• I demonstrated how to combine worksheets manually in the

previous slides. What if there was a way to combine all of your form downloads into one spreadsheet with a click of a button?

• This is where I would like to introduce VBA (Visual Basic for Applications). VBA is an implementation of Microsoft’s event-driven programming language.

All VBA code written by Brandon Sharp

Page 34: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

VBA Workbook• You will be provided with a macro written in VBA to combine all saved form

downloads on the Form Download section of the Intermacs website.

http://www.intermacs.org/reports/form-downloads/

• The macro is in a spreadsheet titled “Consolidate Workbooks”.

• The spreadsheet will contain a button. You click the button, select spreadsheets you wish to combine, and all your form downloads will be consolidated into one!

Page 35: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

You must enable macros• Upon opening the “Consolidate Workbooks” spreadsheet from

www.intermacs.org/reports/form-downloads/, it is imperative that you enable macros in Excel. You will see a yellow warning message. Please be sure to hit “Enable Content” for this.

Page 36: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Excel Macro• Upon opening the “Consolidate Workbooks” spreadsheet from

www.intermacs.org/reports/form-downloads/ , you will see two tabs. The first tab is describing the function and use of this macro. Please click over to the second tab titled “Macro”.

• The following screen should appear:

Page 37: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Excel Macro

• Click the “Run Macro” button and find the location where you have saved the spreadsheets you wish to combine.

Page 38: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Excel Macro

• Select all the workbooks you wish to combine and click open.

Page 39: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

Excel Macro• Within seconds, your new Excel spreadsheet is finished with a tab for each

of your form downloads!

Page 40: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

The code behind the macro• If you are curious to what is happening behind the

scenes (I know I always am!) you can always view the code.

• In your new consolidated spreadsheet, hit alt+F11. This will bring up the VBA within Excel.

Page 41: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

VBA Code in Excel

Page 42: Intermacs Form Download Excel Tutorial Pivot Tables, Graphic Tools, Macros By: Devin Koehl

VBA Code in Excel

• You will notice this code is commented so if the user would like to see what each piece does, they can follow along!

All VBA code written by Brandon Sharp.