Intro to Excel CSCI130-03A Instructor: Dr. Imad Rahal LAYEROrder Application SW: Excel & Access 2 High-order P.L.: Visual Basic1 Low-order P.L.: Assembly3.

Slides:



Advertisements
Similar presentations
Introduction to Excel This class is “HANDS-ON” you will need to open up an excel spreadsheet and do examples as you go along. Students will be able to.
Advertisements

MS EXCEL is a spreadsheet application Excel covers: Calculation Graphic tools Pivot tables Macro programming language called VBA EXCEL is a part of MS.
Introduction to Excel Formulas, Functions and References.
Microsoft Office XP Microsoft Excel
Using Microsoft ® Excel Formulas and Functions Start Microsoft ® Excel. Type data into cells as shown.
Unit 5 Spreadsheets 5.01 Introduction to Spreadsheets.
Microsoft Excel Computers Week 4.
Microsoft Excel The Basics. spreadsheet A type of application program which manipulates numerical and string data in rows and columns of cells. The value.
Exploring Office Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is a Spreadsheet?
Loading Excel Double click the Excel icon on the desktop (if you have this) OR Click on Start All Programs Microsoft Office Microsoft Office Excel 2003.
Objectives 1.Identify the functions of a spreadsheet 2.Identify how spreadsheets can be used. 3.Explain the difference in columns and rows. 4.Locate specific.
MICROSOFT OFFICE 2013 EXCEL 1. 2 File Tab 1 Title Bar 5. Group 7 Name Box 6 Active Cell 8 Formula Bar 4 Ribbon 9 Column 10. Row 11 Sheet Tabs 12 View.
Writing VBA Macros Record a new Macro, recording only the name, shortcut and description Stop recording Open macro for editing and enter VB code Test.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 2 1 Microsoft Office Excel 2003 Tutorial 2 – Working With Formulas and Functions.
Macros Excel built-in functions are great but limited Macros are a means for the user to define new functions A macro is a single command that automates.
Unit G: Using Complex Formulas, Functions, and Tables Microsoft Office Illustrated Fundamentals.
Introduction to Spreadsheets Presented by Frank H. Osborne, Ph. D. © 2005 Bio 2900 Computer Applications in Biology.
L13_1 Microsoft Excel - Building a Worksheet * Excel * Starting Excel and the Excel Window * Entering Text and Numbers * Calculating a Sum * Using the.
1 Computing for Todays Lecture 8 Yumei Huo Spring 2006.
VLOOKUP Better if we have more than two options to select from Corresponding letter grade of numeric grade Must have an accompanying lookup table VLOOKUP(x,y,z)‏
Excel Web App By: Ms. Fatima Shannag.
Introduction to Excel 2007 Part 3: Bar Graphs and Histograms Psych 209.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Lecture 7 Desktop Publishing IV – Spreadsheet Software Introduction to Information Technology With thanks to Dr. A. Zhang, Dr. Haipeng Guo, and Dr. David.
Using Excel To help with data. Excel is a spreadsheet program that can interface with Word, or PowerPoint A spreadsheet program has cells (little blocks)
University of technology Department of Materials Engineering
Exploring Excel 2003 Revised - Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is a.
Managing Business Data Lecture 8. Summary of Previous Lecture File Systems  Purpose and Limitations Database systems  Definition, advantages over file.
Microsoft Excel Diane M. Coyle Spring 2009 CS 105.
XP Abdul Hameed 1 Microsoft Office Excel 2013 Tutorial 2 – Working With Formulas and Functions.
EXCEL INTERMEDIATE 1. WORKSHEETS Worksheet Tabs –Rename by double clicking –Can be moved by click and drag –Change colour by right click and choose Tab.
Working with a Database
Microsoft Excel By: Dr. K.V. Vishwanath Professor, Dept. of C.S.E,
 Introduction to MS-Excel Introduction to MS-Excel  Entering data in EXCEL Entering data in EXCEL  Formulas & Functions in EXCEL Formulas & Functions.
European Computer Driving Licence Syllabus version 5.0 Module 4 – Spreadsheets Chapter 22 – Functions Pass ECDL5 for Office 2007 Module 4 Spreadsheets.
Microsoft Excel Used to organize information for calculations.
Microsoft Excel Spreadsheet Review. Templates  Templates can be produced for the following elements:  Text and Graphics  Formatting Information – Layouts,
 Starting Excel 2003  Using Help  Workbook Management  Cursor Management  Manipulating Data  Using Formulae and Functions  Formatting Spreadsheet.
Spreadsheet A spreadsheet is the computer equivalent of a paper ledger sheet. It consists of a grid made from columns and rows. It is an environment that.
EXCEL. Lesson #1: Introduction to Spreadsheets  You will learn the basics about spreadsheets, cell addresses, rows/columns, and data entry.
Excel Terms Worksheet: a grid of rows and columns Columns – labeled A, B, C, then AA, BB, etc. – 256 columns Rows – numbered 1, 2, 3 through 65,536 Cell.
Spreadsheets and Non- Spatial Databases Unit 4: Module 15, Lecture 1- Spreadsheet Software.
Exploring Office 2003 Vol 1 2/e - Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is.
VBA Lab 2 I ns.Samia Al-blwi. Visual Basic Grammar Object: Visual Basic is an object-oriented language. This means that all the items in Excel are thought.
Chapter 12 Creating a Worksheet.
XP. Objectives Sort data and filter data Summarize an Excel table Insert subtotals into a range of data Outline buttons to show or hide details Create.
Excel Web App By: Ms. Fatima Shannag.
XP 1 Microsoft Office Excel 2003 Working With Formulas and Functions.
Overview Excel is a spreadsheet, a grid made from columns and rows. It is a software program that can make number manipulation easy and somewhat painless.
Spreadsheets What is Excel?. Objectives 1. Identify the parts of the Excel Screen 2. Identify the functions of a spreadsheet 3. Identify how spreadsheets.
Using Microsoft® Excel This presentation is designed for Chapter 1, Section 1.2.
 Columns  Rows  Cells  Ranges  Cell addresses  Column headers  Row headers  Formulas  Spreadsheet.
Microsoft Office 2013 Try It! Chapter 4 Storing Data in Access.
Microsoft Excel ( XP-2003). Return to Table of Contents Table of Contents 1_ Introduction to ExcelIntroduction to Excel 2_ Overview of the Excel.
An electronic document that stores various types of data.
 The term “spreadsheet” covers a wide variety of elements useful for quantitative analysis of all kinds. Essentially, a spreadsheet is a simple tool.
COM: 111 Introduction to Computer Applications Department of Information & Communication Technology Panayiotis Christodoulou.
Excel Tutorial 8 Developing an Excel Application
Spreadsheet – Microsoft Excel 2010
BASIC SKILLS USING EXCEL
MS-Excel Part 1.
Microsoft Excel 101.
Microsoft Excel All editions of Microsoft office.
Microsoft Excel 101.
Intro to Excel CSCI-150.
Introduction to Excel 2007 Part 3: Bar Graphs and Histograms
Unit G: Using Complex Formulas, Functions, and Tables
Spreadsheets and Data Management
Presentation transcript:

Intro to Excel CSCI130-03A Instructor: Dr. Imad Rahal LAYEROrder Application SW: Excel & Access 2 High-order P.L.: Visual Basic1 Low-order P.L.: Assembly3 System Software: O.S.3 Machine Language4 Data Representation5 HW: Circuit Design6

Introduction Spreadsheets are applications used mostly to store, organize, calculate, and display numeric data Tabular format Divided into rows and columns Rows are numbered Columns are labeled with letters Cells hold data (numeric or text), formulas or functions Power: Automatically reapplies formulas as data changes Average of student grades in a grade book Automatically adapts formulas when copied to new locations

Introduction Each Excel file or project is called a workbook File  New  Workbook Each workbook contains 3 worksheets by default Each cell in a worksheet may contain Text Numeric (built-in) Functions Formulas

- Rows are numbered - Columns are assigned letters - L5 is highlighted and formula is shown above the sheet – address is shown in upper left corner - Data is text (left justified), numeric (right justified), formulas and/or functions SHOW “GRADES.XLS” FILE

Formulas Begin with an = sign Either type = in cell Click on the = above worksheet May contain Constants Single cell references: D5 Functions AVERAGE, SUM, etc … Cell ranges: D5:E7 Connections: +, -, *, /, ^, AND, Or, NOT - Formula to calculate average - Changes are automatically reflected - Drag to other cells - Copy/Paste SHOW “GRADES.XLS” FILE

- Formula to calculate average - Changes are automatically reflected - Drag to other cells - Copy/Paste SHOW “GRADES.XLS” FILE

Formulas Once we’ve written the formula for one cell we use it for other rows or columns No need to rewrite it Place cursor on the small square in the lower right corner of cell Hold on the small black that appears by clicking on the right mouse Drag to desired cells Notice how formula changes If target cell is not close to cell holding formula Highlight formula cell then Edit  Copy Go to target cell then Edit  Paste

Formulas Importance of using cell references Formulas can be updated automatically when copied to different cells Formulas can be recalculated when referenced data changes Relative addressing A7 contains formula A5+A6 Copy to B7  ? B7 is one column to the right of A7 Copy to C9  ? C9 is two columns to the right of A7 and 2 rows below it

- What is the formula for the total charge? - How can we apply for the rest of the parents? - Any problems? SHOW “DAY CARE CENTER.XLS” FILE

Formulas Formula is changing as expected but that is NOT what we want Solution 1: write values as constants in formula Changing the values implies changing the formulas A VERY BAD SOLUTION Solution 2: Absolute addressing Place a $ sign before row number  row does not change Place a $ sign before column letter  column does not change Both  cell is fixed New formula

Functions As you enter the = sign The name box changes to a listing of available functions SUM Adds all values in some range Guesses the range SUM(C1:C4) (along a column) SUM(C1:F1) (along a row) SUM(C1:F10) (along a block) Other functions applicable to ranges: AVERAGE, MAX, MIN, COUNT

Conditional Functions IF and VLOOKUP function IF-ELSE and Select Case of VB IF (condition, yes action, no action) SHOW DAY CARE CENTER.XLS Enters one of two possible results in a cell based on condition Employees.xls, IF(G5>50000,10%,12%) Employees.xls, IF(F5=“F”,”Yes”,”No”) Condition part be any equality or an inequality Compound statements by using AND and OR If worker hired before 01/01/1999 and is full time then they would be eligible for a raise =IF(AND(F4="F",H4<DATEVALUE("1/1/1999")),"Yes","No")

VLOOKUP Better if we have more than two options to select from Corresponding letter grade of numeric grade Must have an accompanying lookup table VLOOKUP(x,y,z) x = cell containing value to lookup y = table range (top left and bottom right corners) z = column in table containing the result to write --- always 2 Table must be organized in ascending order from smallest to largest One table entry must match the values being looked up Direct match (equal one of the values) Bounds match (table gives lower bounds of ranges) Once the we get the value of the last cell before we cross the boundaries of range of the given value

SHOW “GRADES.XLS” FILE - TRY VLOOKUP WITH TABLE NAME

Review Power of Spreadsheets derives from Automatically reapplies formulas as data changes Automatically adapts formulas when copied to new cells Given that F11 = G23+E22*$F$2 What would L34 be if the same formula is copied there? M46 + K45*$F$2 A20? B32+#REF!*$F$2

Multiple Sheets A workbook can have many worksheets 3 initially: Sheet1, Sheet2, and Sheet3 Click on the tab for a sheet brings it to the foreground Add new sheets Right on the sheet tab  Insert Delete sheets by clicking on their tab Right on the sheet tab  Delete Rename sheets Right on the sheet tab  Rename (ONE WORD) Rearrange sheets Click on tab, hold down the button, and drag the tab to desired location

Multiple Sheets When a cell referenced in a formula by row and column (e.g. C5)  in current worksheet Reference cells in different sheets, add the sheet name followed by ! Make sure sheet name is a valid variable (1 string with no spaces) Sheet2!C5 Place table on different sheet in grades.xls

Cell Naming A frequently used cell can be named so as not to have to refer to it by its address all the time Type in name in Name Box Hit Enter A range of cells can also be named similarly by selecting it and proceeding as above If you select a row or column with a title, the title is suggested by default

Sorting Much easier than VB On a single column Click on a cell in that column Click on Ascending or Descending sort buttons under SORT AND FILTER in the EDITING group Information in ALL contiguous columns will be moved accordingly To sort only specific columns, highlight desired area and press desired button Data  Sort On more than one column Sort by table by total score DESC and then by student names ASC Sort on names ASC Sort on score DESC

Graphs Click on the INSERT ribbon and use one of the chart types in the chart collection Highlight the data we wish to have on the chart Select the type of chart You can preview your data on every chart Go to Layout Ribbon and add title, gridlines, and data labels Decide where to place chart On the Design Ribbon Click on the location button Notice how updating data changes the graph accordingly

Forecasting and Simulation Not only for data entry, nice formatting and calculating formulas Many functions for simulation and forecasting (whatif analysis) One of which is the Pmt function Returns the payment amount for a loan based on the interest rate and a constant payment schedule Some of the functions are: PMT(RATE, NPER, PV) RATE is the interest rate for the loan NPER is the number of payment periods for the loan PV is the present value or principal of the loan PMT ALWAYS NEGATIVE UNLESS PV is negative Show multisheetHousepmts.xls

Macros Excel built-in functions are great but limited Macros are a means for the user to define new functions A macro is a series of Excel actions Bound together Executed on a single command Similar to “command button” subroutines Good for non-professionals There are two ways to create them Recorded macros Writing macros using VBA (VB for Applications)

Recorded Macros While working with recorded macros and using Visual Basic within Excel, it is helpful to have the Developer ribbon available This ribbon might not be currently visible on the main menu To add the Developer ribbon to the menu, click the Office button and then click Excel Options. In the Popular category, under “Top options for working with Excel”, check the “Show Developer tab in the Ribbon” check box and click OK. To record a macro Click on developer ribbon Within the Code group, choose Record Macro You will get a pop-up window asking for a name, description, and control key for the macro Give your macro a meaningful name, a short description, and assign it to a key for future execution

Recorded Macros Start by positioning the cursor where you want it to be before the macro begins. Once you begin recording, everything you do will be recorded, so you don’t want to position your cursor after you start recording, unless you want the macro to begin in the same cell every time it is executed After you click on ok, the window will disappear and everything you do now will be recorded as part of the macro until you click on Stop Recording in the Code group Now enter the keystrokes you want as part of your macro, pressing the stop recording button when finished When you save an Excel sheet containing a macro, make sure you save as it.xlsm – i.e. macro enabled workbook

Recorded Macros There is an icon in the Code group that allows you to set the addressing mode to relative addressing. If you don’t change this, the default mode for recorded macros is absolute referencing Macros designed with absolute addresses always use the same cells on a worksheet, in other words, if you wanted a macro that would print your name in cell A10 and your e- mail address in B10, you would use absolute addressing You could write the same macro with relative addressing to print your name in whatever cell you position the cursor in, with your address right below it Relative addressing is much more flexible, and what you will want most of the time, so make sure this button is pressed before you start recording your macro when you wish to have your macro use relative addressing

Recorded Macros Past Due Accounting Example Clear Sheet and save Record, Select cells, clear and save Fill penalty column (if overdue=yes) 10% if amount >$120 5% otherwise Check recorded macros Developer  Macros  Click on desired  Edit Complicated to read What is FormulaR1C1? Only good for small things Adding prerecorded text Executing simple formulas

Writing Macros using VBA Much closer to what we did in VB Simpler statements Begin as if you’re recording a macro and stop recording After giving it a name and control character Go and edit the macro Past Due Accounting.xls The ActiveCell and ActiveCell.offset(x,y)

VBA Examples Macros for a single row User places cursor in right spot. Use Activecell.Offset(x,y) Macros that loop downwards Cells(x,y).Select Row=0 Do While ActiveCell.Offset(Row,0)<>””... Row=Row+1 Loop Add the numbers in consecutive cells (in col 1) assuming the first cell is at A1 Dim Number As Single, Sum As Single Dim Row As Integer Cells(1,1).Select Sum = 0 Row = 0 Do While ActiveCell.Offset(Row,0)<>”” Number = ActiveCell.Offset(Row,0) Sum = Sum + Number Row = Row + 1 Loop

Other Features Assigning Macros to Buttons Rather than using Ctrl + Character all the time More handy to have a button Insert  Shapes Draw button Right Click on the button  Assign macro Any of the VB commands can be used InputBox ActiveCell = InputBox(“Enter you name”,”Namebox”) Msgbox

Other Features Reading data from data files Open file, assign the data to the active cell and them move cell down to across the sheet File in same folder as project directory Open ActiveWorkbook.Path & "\data.txt" For Input As #1

File Input in Excel Design macros for the following, each activated by a separate button (1) Ask the user for her name via an inputbox and store in active cell (2) Read data from a text file Salesperson, Sales Write salespersons in column A and their sales in column B starting row 4 (3) Find the salesperson with the highest sales and display his/her name (4) Find sales of an input salesperson (3) Find salespersons with sales >= some input The number of salespersons is not known but The row after the last salesperson is empty

File Input in Excel Sub ReadSalesPersons() Dim Sales As Single, Row As Integer Dim Salesperson As String Open ActiveWorkbook.Path & "\sales.txt" For Input As #1 Range(“A4”).Select Row=0 Do While Not EOF(1) Input#1, Salesperson, Sales ActiveCell.Offset(Row,0) = Salesperson ActiveCell.Offset(Row,1) = Sales Row = Row + 1 Loop End Sub

File Input in Excel Sub FindMax () Dim MaxSales As Single, MaxiName As String Dim Row As Integer Range(“A4”).Select ‘place on first name Row = 0 MaxiName = ActiveCell.Offset(0,0) MaxiSales =ActiveCell.Offset(0,1) Do While ActiveCell.Offset(Row,0)<>”” If(ActiveCell.Offset(Row,1) > Maxi) Then Maxi = ActiveCell.Offset(Row, 1) MaxiName = ActiveCell.Offset(Row,0) End If Row = Row + 1 Loop Msgbox “The salesperson with the highest sales is:” & MaxiName,, FormatCUrrent(MaxiSales) End Sub

Excel Problems Summaries: (1) Do something for the Selected-Row using VBA ActiveCell.Offset(x,y) (2) Loop throughout a sheet using VBA Range(“XY”).Select Row=0 Do While ActiveCell.Offset(Row,0)<>”” … Row = Row + 1 Loop (3) Reading from a file to a sheet Do While Not EOF(1)

File Input in Excel Design macros for the following, each activated by a separate button (1) Ask the user for her name via an inputbox and store in active cell (2) Read data from a text file Salesperson, Sales Write salespersons in column A and their sales in column B starting row 4 (3) Find the salesperson with the highest sales and display his/her name (4) Find sales of an input salesperson (3) Find salespersons with sales >= some input The number of salespersons is not known but The row after the last salesperson is empty

File Input in Excel Sub ReadSalesPersons() Dim Sales As Single, Row As Integer Dim Salesperson As String Open ActiveWorkbook.Path & "\sales.txt" For Input As #1 Range(“A4”).Select Row=0 Do While Not EOF(1) Input#1, Salesperson, Sales ActiveCell.Offset(Row,0) = Salesperson ActiveCell.Offset(Row,1) = Sales Row = Row + 1 Loop End Sub

File Input in Excel Sub FindMax () Dim MaxSales As Single, MaxiName As String Dim Row As Integer Range(“A4”).Select ‘place on first name Row = 0 MaxiName = ActiveCell.Offset(0,0) MaxiSales =ActiveCell.Offset(0,1) Do While ActiveCell.Offset(Row,0)<>”” If(ActiveCell.Offset(Row,1) > Maxi) Then Maxi = ActiveCell.Offset(Row, 1) MaxiName = ActiveCell.Offset(Row,0) End If Row = Row + 1 Loop Msgbox “The salesperson with the highest sales is:” & MaxiName,, FormatCUrrent(MaxiSales) End Sub

Excel Problems Summaries: (1) Do something for the Selected-Row using VBA ActiveCell.Offset(x,y) (2) Loop throughout a sheet using VBA Range(“XY”).Select Row=0 Do While ActiveCell.Offset(Row,0)<>”” … Row = Row + 1 Loop (3) Reading from a file to a sheet Do While Not EOF(1)