Вы находитесь на странице: 1из 16

Formulas and Functions Excel 2010

Produced by Flinders University Centre for Educational ICT

Contents
Layout ................................................................................................................................................................ 1 The Ribbon Bar .................................................................................................................................................. 2 Minimising the Ribbon Bar ............................................................................................................................. 2 The File Tab ....................................................................................................................................................... 3 What the Commands and Buttons do ........................................................................................................ 3 The Quick Access Toolbar................................................................................................................................. 4 Customising the Quick Access Toolbar ......................................................................................................... 4 Entering & editing simple formulas .................................................................................................................... 6 To enter a formula .......................................................................................................................................... 6 Range Finder ..................................................................................................................................................... 6 To locate or change cells referenced in a formula - ....................................................................................... 6 Entering formulas more efficiently ..................................................................................................................... 7 The AutoSum function ....................................................................................................................................... 7 Grand totals ................................................................................................................................................ 7 View totals .................................................................................................................................................. 7 Copying formulas ........................................................................................................................................... 7 Relative and absolute cell references ............................................................................................................ 8 Functions ........................................................................................................................................................... 8 Typing Functions ............................................................................................................................................ 8 Entering a formula containing a function ........................................................................................................ 8 Statistical functions ..................................................................................................................................... 9 Logical functions ......................................................................................................................................... 9 Lookup and Reference functions ................................................................................................................ 9 Using range names in formulas ....................................................................................................................... 10 Defining a range name ............................................................................................................................. 10 Navigating with range names ................................................................................................................... 10 Creating range names .............................................................................................................................. 10 Building formulas with range names ........................................................................................................ 10 Applying range names to formulas ........................................................................................................... 10 Naming a (constant) value ....................................................................................................................... 11 Calculations involving several sheets .............................................................................................................. 11 Linking files or worksheets with formulas..................................................................................................... 11 Grouping worksheets ................................................................................................................................... 11 Copying and entering formulas across a range ........................................................................................... 11 Consolidating data ........................................................................................................................................... 12 Array formulas ................................................................................................................................................. 13 Formula Examples ........................................................................................................................................... 14 A basic Mark Sheet .................................................................................................................................. 14 Basic Finance sheet ................................................................................................................................. 14

Flinders University Centre for Educational ICT

Updated 13/07/2010

Layout
Once you know your way around Excel youll find it much easier to use. Excel is made up of a number of different elements. Some of these elements, like the File Tab, Ribbon Bar and Quick Access tab may not be familiar to you if you have used another version of Office. If not, dont worry, they soon will be. 1. The File Tab is used to access file management functions such as saving, opening, closing, printing, etc. Options is also available here so that you can set your working preferences for the application (this replaces Tools > Options in 2003). 2. The Ribbon bar is the tabbed band that appears across the top of the window. It is the control centre of all office 2010 applications. Instead of menus, you can now use the tabs on the Ribbon to access commands which have been categorised into groups. The commands include galleries of formatting options that you can select from, such as the Styles gallery shown here. 3. The Quick Access Bar also known as the QAT is a small toolbar that appears at the top left-hand corner of the window. It is designed to provide access to the tools you use most frequently and includes by default the Save, Undo and Redo buttons. You can add buttons to the Quick Access Toolbar to make finding your favourite commands easier. 4. The Status Bar appears across the bottom of the window and displays application information, eg. sheets, cell count, auto sum amount, and so on. It can also be customised to have more functions showing by right-clicking on the bar and choosing the options. The View buttons and the Zoom Slider are used to change the view or to increase/decrease the zoom ratio for your document.

3 1 2

Flinders University Centre for Educational ICT

The Ribbon Bar


The Ribbon is the new command centre for Office. It provides a series of commands organised into groups and placed on relevant tabs. Tabs are activated by clicking on their name to display the command groups. Commands are activated by clicking on a button, tool or gallery option. The Ribbon is intended to make document design more intuitive.

Minimising the Ribbon Bar


The wide band and use of icons makes it very quick and easy to find and apply commands and settings. However, if you are working on a large document with lots of text, it may suit you to hide the ribbon, either temporarily or permanently, while you are working. To hide the Ribbon bar click on a tab then double click the same tab. This will hide the bar. To access it just single click on a tab then select your function. The bar will then disappear again. To reactivate it, double click on one of the tabs again. Or click on the arrow on the right to open and close the ribbon bar.

Flinders University Centre for Educational ICT

The File Tab


The File Tab is one the major changes in Office 2010. This replaces the File menu in 2003 and the Office Button in 2007. The File Tab provides access to all of the file-related commands such as Open, Save and Print.

What the Commands and Buttons do


Save Save As Open Close Info Saves your current document using the default file format. Saves the current document with the option to change the file format, name or location. Opens an existing document. Closes your existing document. Displays different commands, properties, and metadata depending on the state of the document and where it is stored. Commands on the Info tab can include Permissions, Versions & Convert document. Displays the recent documents and recent places that have been saved or opened. Creates a new document, based either on a blank template, an installed template or an online template. The Print panel now combines print preview and print options into one screen. Sends your document via email or Internet fax. Opens the help menu. Opens the Word Options dialog box so that changes to the default settings can be made. Exits from Microsoft Word. If any unsaved documents are open, you will be prompted to save them.

Recent New

Print Save & Send Help Options


Exit

Flinders University Centre for Educational ICT

The Quick Access Toolbar


The Quick Access Toolbar, also known as the QAT, is a small toolbar that appears at the top left-hand corner of the window. It is designed to provide access to the tools you use most frequently and includes by default the Save, Undo and Redo buttons. You can add buttons to the Quick Access Toolbar to make finding your favourite commands easier. The Quick Access Toolbar is positioned immediately to the right of the File Tab.

Customising the Quick Access Toolbar


The Quick Access Toolbar can be customised by adding buttons or removing buttons. This is the only part of the office interface that you can modify you cant add buttons to the ribbon or command groups. There are two methods that can be used to customise the toolbar The Customise Quick Access Toolbar tool displays a list of commonly used commands that you can add to the toolbar. Click on the items that you want to add. The tick on the left of the word indicates what is active in the list.

1. You can add any command you like to the toolbar by selecting More Commands to display the Options dialog box. From here you can choose commands or tabs to add to the toolbar. Once in the QAT Toolbar you can place the icons into an order that suites your work by highlighting the icon and using the arrows on the right side to move up or down. You can even shift the Quick Access Toolbar below the ribbon if this suits the way you work.

Flinders University Centre for Educational ICT

2. By right clicking on a function (eg Autosum) you can add it to the Quick access bar.

Flinders University Centre for Educational ICT

Entering & editing simple formulas


If you used formulas of any sort at school, you will find it easy to use formulas in Excel. The same structure or syntax applies; that is, if you want to multiply two numbers (say, 5 and 6) together, on paper you would write 5 x 6, and in Excel you would type 5*6. The obvious difference is that Excel uses an asterisk as the symbol for multiplication. There is a short list of the main symbols used below. You will see that they are mainly as written at school.

To enter a formula
select a cell and type the equals symbol (=) begin typing the information (numbers or operator symbols) you can insert a cell reference into your entry by typing, by pointing and clicking the cell, or by selecting the range when finished, enter the information by pressing Enter OR by clicking on the tick button in the Formula bar if you change your mind about the entry you can cancel it with the ESC key OR the cross button in the formula bar, provided it has not yet been entered if you make a mistake while typing, use the Backspace key to remove a character to the left of the cursor once you have entered the formula, you can make changes by selecting the cell and clicking in the formula bar, OR by double clicking the cell, to go into edit mode Note: that by default numbers are align to the right and text is aliened to the left. You can change this if you want some different alignment. If a text entry is too long to display in the cell, it will seem to flow into the cell to the right if this is empty. Otherwise, it will appear truncated although it is all still actually in the cell. Number entries that are too long appear as #####. This is fixed by making the column wider. All formulas must begin with the = symbol. They may contain operators such as: + add subtract * multiply / divide

Range Finder
As you edit a formula, all cells and ranges to which the formula refers are displayed in colour, and a matching colour border is applied to the cells and ranges. Locating or changing the cells to which a formula refers using Range Finder

To locate or change cells referenced in a formula double-click the cell that contains the formula you want to change OR select the cell and click in the formula bar. Excel highlights each cell or range with a different colour to change a cell or range reference to a different cell or range, drag the colour-coded border of the cell or range to the new cell or range to include more or fewer cells in a reference, use the drag handle in the lower-right corner of the border to select more or fewer cells when you finish updating the references, press Enter (If the formula is an array formula, press Ctrl+Shift+Enter)

Flinders University Centre for Educational ICT

Entering formulas more efficiently


Instead of spelling out in full the details of all cells whose contents you wish to add together, you could use a built-in Excel function. The function for adding a series of numbers is SUM(..). You can specify the range by typing it OR by selecting it with the mouse. A normal calculation would be: =B1+B2+B3+B4+B5+B6+B7+B8+B9. Using Sum function it would be: =SUM(B1:B9) To use the SUM function select the cell where the sum is to go type =sum( note that it can be lower case, there are no spaces, and you must include the open bracket drag the mouse pointer over (i.e., select) the cells to be added (OR type in the range reference) press Enter OR click the Tick in the formula bar (in this case Excel adds the closing bracket for you because it is a simple and straightforward function but dont develop this habit!)

The AutoSum function


Above you typed in the formulas. You can access Excels SUM function a much quicker way by using the AutoSum button on the toolbar. This is located on the Home tab at the left end. The dropdown arrow on the right gives you access to other functions like Average and count numbers. To use AutoSum select the cell where the formula is to go click on the AutoSum button - Excel attempts to guess the range you wish to add: if it guesses wrongly simply drag your mouse pointer over the correct range press Enter OR Click the click the tick in the formula bar To add totals to a block of data select the range containing the data and the cells where you want totals click on the AutoSum button - Excel immediately inserts the totals in the blank cells

Grand totals
If your worksheet contains multiple subtotal values created with the SUM function, you can create a grand total for the values by using AutoSum. To create a grand total, click a cell below or to the right of the range that contains the subtotal values then click AutoSum. AutoSum will automatically select all the previous AutoSums.

View totals
If you simply want to display the total value of a range of cells without placing the total anywhere in the sheet, you can use the AutoCalculate feature. When you select cells, Excel shows the Average, Cell Count and sum of the range in the status bar at the bottom of the worksheet. AutoCalculate can perform different types of calculations for you. When you rightclick the status bar, you can select other functions such as the minimum, or maximum value of the selected range.

Copying formulas
You can use any of the methods you might use to copy data from one cell or range to another (including drag-and-drop) to copy a formula to another cell or range. A common way of copying formulas is to use the Fill function. Select the cell with the formula in it. In the lower right corner of the cell is the fill handle. (your cursor will change to a + sign when you are over it) Drag this in the direction you want to copy the formula too.

Flinders University Centre for Educational ICT

Relative and absolute cell references


The above paragraph addressed copying formulas across or down your sheet. If you inspect such copied formulas, you will see that Excel automatically changed the cell references in them relative to their new locations. This type of reference is called a relative reference, and is the type Excel uses by default, i.e., unless you tell it otherwise. This is handy as it is usually what you want - but not always. The other type of reference is the absolute reference. When you copy a formula containing this type of reference, it does not change. This is useful when you want to put a formula in more than one cell and you want it to refer to the same source cell in all cases. (There are also references where the row may be fixed but the column can change, or vice versa; these are mixed references.) To enter an absolute reference in a formula as you type in a formula, either type the reference or point and select the cell(s) in the sheet to add the reference while the cursor is still next to the reference in the formula bar, press F4 Dollar symbols will appear in the reference; e.g., C6 will become $C$6 to indicate that the reference always refers to a fixed column (C) and fixed row (6).

Functions
Earlier you used the SUM function in a formula as a way of shortening a tedious procedure. Excel has many inbuilt functions that not only speed up your work, but also permit you to perform very complex calculations and manipulations.

Typing Functions
If you are familiar with the function that you need you can type it into a cell exactly the same way you type any other formula. If you are not sure if Excel has a function or you cant quite remember how it is written you can use the Insert Function tool on the formula bar to assist you. When you click on this tool the Insert Function dialog box will be presented to you which lists the most recently used or common functions and also allows you to search for other functions that you might need. In the Formulas Tab they have also been grouped into 8 categories for step by step application.

Entering a formula containing a function


select the cell in which you want to enter the function choose the Formula Tab choose the category and then a function or click the Insert Function button If you dont know what function to use, use Search for a function when you click on Insert Function entre the information required for each of the fields either by typing OR select the cell range on the sheet click OK Note: you must stick to the correct syntax or the function will not work correctly. Case is not important (i.e., you may use capitals or not). Flinders University Centre for Educational ICT 8

Statistical functions
These functions calculate averages, minima, maxima, and so on. The required syntax is: =min(range) =max(range) =average(range) =count(range) =counta(range) The count function counts cells containing numbers, and the counta counts alphanumeric.

Logical functions
You probably make conditional decisions fairly often. These are where you deci de If A is the case I will do this, but if B is the case I will do that. In the same way logical functions allow Excel to produce different results depending on which condition(s) hold(s) true. The IF function is extremely useful for this purpose. It uses the following syntax: =IF(logical_test,value_if_true,value_if_false). That is, if the test is found to be true, value_if_true applies; otherwise value_if_false applies. Here are some examples of how it is used. =IF(J10>100,K10,L10) =IF(B6>M1*M6,C6*1.3,C6/1.3) =IF(M12>B7,150,F12*1.25) Complex IF function o =IF(AND(B55>100,B6<1),C4/C5,99) o =IF(OR(B6+C6=D6,E6=Yes),Balanced,Not balanced) Nested IF function o =IF(G7>=84.5,"HD",IF(G7>=74.5,"DN",IF(G7>=64.5,"CR",IF(G7>=49.5,"P","F")))) Note: the AND and OR complex operators used in the 4th and 5th examples. Also note that the simple arithmetic operators +, -, *, and / , and =, <, >, <=, >=, and <> can be used.

Lookup and Reference functions


At some time or other, you have probably needed to use tables in which you look up a value that corresponds to some search value. One example of this is the logarithm table. Another is a price list in which you look up the price of a particular item. In Excel you can do this with the various lookup functions. The most common is the Vlookup function that allows you to find information listed in a vertical table. Hlookup is for use with horizontally organised data. The syntax is: =VLOOKUP(lookup_value,table_array,col_index_num) where lookup_value is the information you are using for your search, table_array is the range in which the required information is to be found, and col_index_num indicates in which column of the range the item will be located. The information in the table should be arranged in ascending order of the lookup value, as the function searches for a match to this value. If it finds a match, the search stops and returns the corresponding value as the result. If it does not find a match, the search stops at the first value exceeding the lookup value, and returns the corresponding item for the previously listed lookup value. Where you have not sorted by the left (lookup) column of the table, you need to enter a fourth parameter in the function. The argument False tells Excel to keep looking even though it has already found a value higher than the one required.

Flinders University Centre for Educational ICT

Using range names in formulas


You saw earlier that you can refer to a group of (one or more) cells as a range. You can also give an identifying name to a range. This has several benefits. You can navigate around the sheet by using the GoTo function and selecting the range name. You can use the range name in formulas instead of entering the range cell references - you can type in or insert these. And you can refer to parts of your sheet using names that have some meaning to you.

Defining a range name


You assign a name to a range by defining it. The name you use can be upper and/or lower case, and may include digits. The name may be up to 255 characters long, but it is wise to keep it short. To define a range name select the range you wish to name choose Formulas Tab then Define Name if the selection is a single cell and there is a (text) label above or to the left, the Names in workbook: text box will propose this as the range name; otherwise type in a name choose OK

Navigating with range names


EITHER: press F5 to open the Go To window, and select the range name OR: select the name from the Name Box drop-down list on the Formula toolbar

Creating range names


When you define range names you do them one range at a time. However you can name several ranges simultaneously. The create command defines a separate name for each row or column in the selection, using labels from the cells at the left of or along the top of the selected range. To create several range names select the cells you want to include in the named ranges and the cells containing the names select Formulas tab then Create from Selection a Create Names box will appear asking where the titles are. Eg. Top row, left column. Select which one and press OK to check the range names click the drop down arrow in the Name box on the Formula bar.

Building formulas with range names


Once you have named ranges you can use these when constructing formulas. You will find it can make the task much easier, as it makes more sense to think in terms of what the ranges represent than to think of cell references. For example, which of these is easier to understand? (K27) = K25 - K12 or (Profit) = Revenue - Expenses To use range names in formulas select the cell to contain the formula and type any part that needs typing type the range name, spelling it exactly as defined. A popup list will appear to confirm your name if necessary, complete the formula by further typing or inserting, and press Enter

Applying range names to formulas


You may already have placed formulas in your spreadsheet before you decide to name ranges on the sheet. If you now want to change the formulas from cell references to range names, you have the choice of changing each formula manually or letting Excel do it for you. This method finds references that match named ranges and substitutes them in the formulas. choose Formulas Tab click the arrow next to Define Names then select Apply Name to show the Apply Names dialog box either accept Excels choice of names or select those you want to apply choose OK Flinders University Centre for Educational ICT

10

Naming a (constant) value


Some of the formulas you build may use a constant value rather than a cell reference. You can also assign a name to a constant, and therefore still build formulas around constants using words that make sense to you. This also means that the constant does not need to appear anywhere on the worksheet. To name a constant select the Formulas Tab then Define Name in the Name: text box type the name for your constant in the Refers to: text box type the value then choose OK

Calculations involving several sheets


Linking files or worksheets with formulas
You can build a formula in one sheet that refers to data in another. It is just like building a formula containing cell references on the same sheet. When the content of the source cell(s) changes, the formula updates the result because the files are linked. The procedure is similar to using same-sheet references, but you must either type in the source filename, the specific sheet name, and maybe a path name to indicate where the file is; or activate the source file and select the reference cell or range from there. A linked workbook reference may look like this: =Sheet1!C7 or =[census.xlsx]Sheet1!$C$7 Note: that using range names could also make this task easier.

Grouping worksheets
If you are setting up a file in which several sheets are to have the same layout, formatting, and so on you can group the sheets and work on them simultaneously. That is, you can enter data or formulas and edit them, format a range in all grouped sheets, etc. You can even print several sheets together. To group sheets in a workbook select the first sheet by clicking its tab; THEN EITHER: hold the Shift key and select the last required sheet tab to group adjacent sheets OR: hold the Ctrl key and select further sheets in turn for non-adjacent sheets To select all sheets in the workbook - choose Select All Sheets when you right click on a sheet tab. To deselect or ungroup choose Uungroup Sheets when you right click on the selected sheets or select a non-grouped sheet.

Copying and entering formulas across a range


To copy one or more formulas across a range of sheets select the sheets to which you want to copy (and include the source sheet) select the range you intend to copy in the source sheet select the Home Tab, Fill, Across Worksheets to open the dialog box select the required Fill option (All / Contents / Formats) and choose OK To enter a formula across a range of sheets select the sheets in which you want the formula enter the formula in the cell on the active sheet this will place the formula into the same cell in all the selected sheets

Flinders University Centre for Educational ICT

11

Consolidating data
To consolidate several sets of data into one worksheet you need to combine them in a way that adds together the values in corresponding cells in the various sheets. Using linking formulas is one way to do this. The Paste Special command offers other options that make this possible. And you can consolidate based on position or by category. To consolidate data from several sheets by pasting select the sheet you are adding the data to (we will call it the new sheet) select the first sheet with data to consolidate, then highlight and copy the data select the new sheet and select the location to paste the data choose Home Tab, Paste, Paste Values; leave the range highlighted select the next sheet with data to consolidate, then highlight and copy the data select the new sheet and choose Paste, Paste Special select the Values paste option and the Add operation, and check the Skip blanks check box choose OK repeat the process to add further data ranges To consolidate data by category click the upper-left cell of the destination area for the consolidated data on the Data tab, click Consolidate in the Function box, select the summary function you want Excel to use eg SUM in the Reference box, enter a source range you want to consolidate. Make sure to include the data labels in the selection click Add repeat the above 2 steps for each source range you want to consolidate under Use labels in, select the check boxes that indicate where the labels are located in the source area: either the top row, the left column, or both to update the consolidation table automatically when the source data changes, select the Create links to source data check box To create links, the source and destination areas must be on different worksheets. Once you create links, you cannot add new source areas or change the source areas that are included in the consolidation. Note - Labels in a source area that do not match any labels in the other source areas result in separate rows or columns when you consolidate data. Note also - To consolidate by position, follow the above procedure but do not set the Use labels in check boxes.

Flinders University Centre for Educational ICT

12

Array formulas
An array formula can perform multiple calculations and then return either a single result or multiple results. Array formulas act on two or more sets of values known as array arguments. Each array argument must have the same number of rows and columns. You create array formulas the same way that you create basic, single-value formulas. Select the cell or cells that will contain the formula, create the formula, and then press Ctrl+Shift+Enter to enter the formula. To calculate multiple results with an array formula, you must enter the array into a range of cells that has the same number or rows and columns as the array arguments. Entering an array formula When entering an array formula, Excel automatically inserts the formula between braces { }. To enter an array formula select the cell or cells where you want to enter the formula (depending on whether you want one result or several) type the array formula in the usual manner eg =B3:B6*C3:C6 OR =SUM(B3:B6*C3:C6) press Ctrl+Shift+Enter Editing array formulas select any cell in the array range click in the formula bar; when in edit mode (i.e., the formula bar is active), the braces ( { } ) do not appear in the array formula edit the array formula in the usual manner press Ctrl+Shift+Enter

Flinders University Centre for Educational ICT

13

Formula Examples
A basic Mark Sheet
Assign 1 ID Lastname Firstname 40% 52 67 58 Assign Assign Assign 1 2 3 0.4 52 67 58 0.2 65 86 74 0.4 25 87 65 =SUM(D4*$D$3)+(E4*$E$3)+(F4* $F$3) =SUM(D5*$D$3)+(E5*$E$3)+(F5* $F$3) =SUM(D6*$D$3)+(E6*$E$3)+(F6* $F$3) =IF(G4>=84.5,"HD",IF(G4>=74.5,"DN",IF(G4>=64.5,"CR",IF(G4>=49 .5,"P","F")))) =IF(G5>=84.5,"HD",IF(G5>=74.5,"DN",IF(G5>=64.5,"CR",IF(G5>=49 .5,"P","F")))) =IF(G6>=84.5,"HD",IF(G6>=74.5,"DN",IF(G6>=64.5,"CR",IF(G6>=49 .5,"P","F")))) Total Assign 2 20% 65 86 74 Assign 3 40% 25 87 65 44 79 64 F DN P Grade Total Grade

Basic Finance sheet


Income Total Budget Total Actual Remaining 32,581.55 12,800.00 3,775.16 28,806.39 Budget Income Project 1 Project 2 Travel Photocopier Stationery Total Income =C7 Total Budget =B13 Total Actual =C13 Remaining =B1-B3 Budget Income Project 1 Project 2 Travel Photocopier Stationery 4000 1000 5000 1800 1000 Actual Jan Feb =20000+902 .21+1440 =224.18 =159.09+21.79 159.09 =159.09 =19.64+185. 45 Mar Apr May Jun =SUM(D7:I7 ) 10239.34 =SUM(D8:I8 ) =SUM(D9:I9 ) =SUM(D10:I 10) =SUM(D11:I 11) =SUM(D12:I 12) =482.09+185 653.96 447.76 103.26 =470.03 =417.76 =86.97 4,000.00 1,000.00 5,000.00 1,800.00 1,000.00 12,800.00 Actual 32,581.55 928.33 0.00 0.00 2,002.64 844.19 3,775.16 0.00 224.18 667.09 653.96 1,501.93 447.76 103.26 710.11 629.12 470.03 417.76 86.97 709.82 Jan 10,239.34 Feb 22,342.21 224.18 180.88 159.09 159.09 205.09 Mar Apr May Jun

=SUM(B7:B =SUM(C8:C =SUM(D8:D12 =SUM(E8:E Total 12) 12) ) 12)

=SUM(G8:G12 =SUM(H8:H12 =SUM(I8:I12 =SUM(F8:F12) ) ) )

Flinders University Centre for Educational ICT

14

Вам также может понравиться