Académique Documents
Professionnel Documents
Culture Documents
Lock. Alt+ key F9 + enter crl+key turns a reference to a value !aca e e"presie
#o select a tab by using the keyboar!, use $trl+%g&p or $trl+%g'n, or simply press the first letter of the tab that you want to activate. 'epen!ing on your regional settings, entering a !ate in a format (such as June 1, 2004) may be interprete! as te"t rather than a !ate
For more control over what gets deleted, you can use the Edit Clear command. All of these methods cause Excel to go into edit mode. (The word EDIT appears at the left side of the status bar at the bottom of the screen. !hen the Fixed "ecimal option is set, Excel supplies the decimal points for you automatically. For example, if you enter 12345 into a cell, Excel interprets it as #$%.&'. ((t adds the decimal point. (f you have lengthy text in a cell, you can force Excel to display it in multiple lines within the cell. )se Alt*Enter to start a new line in a cell. Excel includes +uite a few built,in AutoCorrect terms (mostly common misspellings , and you can add your own. To set up your custom AutoCorrect entries, use the ToolsAutoCorrect -ptions command. To enter a fraction into a cell, leave a space between the whole number and the fraction. For example, to enter ./01, enter 6 7/8, and then press Enter
Several solutions to this problem are available. You can format the cells to !isplay more !ecimal places. You can use the ROUND function on in!ivi!ual numbers an! specify the number of !ecimal places )"cel shoul! roun! to. *r you can instruct )"cel to change the worksheet values to match their !isplaye! format. #o !o this, choose #ools*ptions, select the $alculation tab, an! then check the %recision as 'isplaye! check bo".
Add a macro
1. Choose ViewToolbarsCustomize to open the Customize dialog box. 2. If the toolbar to which you want to add the custom button is not already open, select the Toolbars tab and then select the toolbar s chec! box to display it in the "xcel screen. #. $elect the Commands tab and then select %acros near the bottom of the Categories list box, as shown in &igure 2'(. )hen you select the %acros category, the Commands list box gi*es you a choice between a Custom %enu Item and a Custom +utton. , &igure 2'(- The %acros category contains two choicesCustom %enu Item and Custom +utton. (. .rag the Custom +utton /with the 0appy &ace icon1 and drop it into position on the toolbar from which you want to be able to run the macro or select the hyperlin!.
2. 3ight'clic! the Custom +utton you 4ust added to the toolbar and then clic! either the 5ssign 0yperlin!6pen item /to attach a hyperlin! to it1 or the 5ssign %acro item /to attach a macro to it1 on the shortcut menu, shown in &igure 2'2. If you choose 5ssign 0yperlin!6pen, "xcel opens the standard 5ssign 0yperlin! dialog box where you can select an existing file or )eb page or e'mail address to lin! to. If you choose 5ssign %acro, the program opens the 5ssign %acro dialog box where you can select the macro to run when the button is clic!ed. Not showing errors &ollow these steps to use the Conditional &ormatting feature1. $elect the cell or range of cells containing the error *alues you want to blan! out. 2. Choose &ormatConditional &ormatting. #. Clic! the drop'down button in the box that reads Cell Value Is and select &ormula Is from its pop'up menu. (. Type 7I$"3363/ in the text box to the right. 2. 3eselect the cell or range of cells containing the error *alues you want blan!ed out or type their addresses.
Worksheets
2ress Ctrl*Tab (or Ctrl*F. to cycle through all open windows until the window that you want to wor3 with appears on top as the active window Ctrl+PgUp: Activates the previous sheet, if one exists To copy a wor3sheet, clic3 the wor3sheet tab, press Ctrl, and drag the tab to its desired location (either in the same wor3boo3 or in a different wor3boo3 . Also right clic3 * move4copy option To hide a wor3sheet, choose Format 5heet6ide. The active wor3sheet (or selected wor3sheets will be hidden from view. To create and display a new view of the active wor3boo3, choose !indow 7ew !indow. To create a named view, begin by setting up the view settings the way you want them (for example, hide some columns . Then select 8iew Custom 8iews to display the Custom 8iews dialog box. Clic3 the Add button and provide a name in the Add 8iew dialog box that appears (see Figure %,9 . :ou can also specify what to include in the view by using the two chec3 boxes. Clic3 -; to save the named view. The !atch !indow is actually a special type of toolbar. To display the !atch !indow toolbar, choose 8iewToolbars!atch !indow. Then clic3 Add !atch and specify the cell that you want to watch To hide rows or columns in your wor3sheet, select the row or rows that you want to hide and then choose Format <ow6ide. -r select the column or columns that you want to hide and then choose FormatColumn6ide. Working with cells an ranges
2ress Ctrl*spacebar to select a column. The column of the active cell (or columns of the selected cells is highlighted. 2ress 5hift*spacebar to select a row. The row of the active cell (or rows of the selected cells is highlighted. Excel provides an easy way to locate these and many other special types of cells. :ou do this by choosing Edit =o To to display the =o To dialog box and then clic3ing the 5pecial button to display the =o To 5pecial dialog box, Cop!/paste To see the clipboard Edit, office clipboard "anges To create a range name, start by selecting the cell or range that you want to name. Then, select (nsert7ame"efine (or press Ctrl*F% . Excel displays the "efine 7ame dialog box, which is shown in Figure &,#> To create a table of names, first move the cell pointer to an empty area of your wor3sheet?the table is created at the active cell position and will overwrite any information at that location. )se the (nsert 7ame2aste command (or press F% . Excel displays the 2aste 7ame dialog box, which lists all the defined names. To paste a list of names, clic3 the 2aste @ist button. Co##ents To add a comment to a cell, select the cell and then choose (nsertComment (or press 5hift*F$ . To delete a cell comment, activate the cell that contains the comment, right,clic3, and then choose "elete Comment from the shortcut menu.
$or#ating To merge styles from another wor3boo3, open both the wor3boo3 that contains the styles that you want to merge and the wor3boo3 into which you want to merge styles. From the wor3boo3 into which you want to merge styles, choose Format 5tyle and clic3 the Aerge button. Excel displays the Aerge 5tyles dialog box with a list of all open wor3boo3s. 5elect the wor3boo3 that contains the styles you want to merge and clic3 -;. Excel copies styles from the wor3boo3 that you selected into the active wor3boo3.
Un erstan ing %iles an te#plates The -pen button is actually a drop,down list. Clic3 the arrow, and you see the additional optionsB &pen: -pens the file normally. &pen "ea '&nl!: -pens the selected file in read,only mode. !hen a file is opened in this mode, changes cannot be saved to the original filename.
&pen as Cop!: -pens a copy of the selected file. (f the file is named budget.xls, the wor3boo3 that opens is named Copy of budget.xls. &pen in (rowser: -pens the file in your default !eb browser. &pen an "epair: -pens the file after a crash and recovers from any damage that may have resulted from the crash.
+any people work on the same workbooks each !ay. ,f this !escribes you, you-ll be happy to know that you can have )"cel open specific workbook files automatically whenever you start )"cel. #he .LStart fol!er is locate! within your )"cel !ocument fol!er. For e"ample, the path may be/ C:\Documents nd !ett"ngs\#use$n me%\&ppl"c t"on D t \'"c$osoft\Excel\()!t $t Another .LStart fol!er may be locate! here/ C:\*$og$ m +"les\'"c$osoft Off"ce\Off"ce,,\()!t $t
The 5ave As dialog box has a drop,down menu labeled Tools. !hen you clic3 this menu, one of the options displayed is labeled =eneral -ptions !hen your wor3boo3 is set up to your li3ing, select File 5ave As. (n the 5ave As dialog box, select Template (C.xlt from the box labeled 5ave As Type. Enter )ook*+lt for the filename.
)"cel will offer the name -oo.,.xlt. You must change this name to boo..xlt if you want )"cel to use your template to set the workbook !efaults. After you create your boo..xlt or s/eet.xlt templates, you may discover that
you need to change them. :ou can open the template files and edit them Dust li3e any other wor3boo3. After you ma3e your changes, save the file and close it. To save the wor3boo3 as a template, choose File 5ave As and select Template (C.xlt from the drop,down list labeled 5ave As Type. 5ave the template in your Templates folder?which Excel automatically suggests?or a folder within that Templates folder.
0efore you save the template, you may want to specify that the file be save! with a preview image. Select File%roperties an!, in the Summary tab, check the bo" labele! Save %review %icture. Print ,f you are printing multiple copies of a report, make certain that the $ollate check bo" is selecte!. ,f you choose this option, )"cel prints the pages in or!er for each set of output. ,f you-re printing only one page, )"cel ignores the $ollate setting.
To insert bra3es First line ,E v brea3 insert brea3 First column ,E h brea3 insert brea3 Working with %or#,las an %,nction To refer to a cell in a different wor3boo3, use this formatB
01WorkbookName2SheetName3CellAddress
,f the worksheet name in the reference inclu!es one or more spaces, you must enclose it in single 1uotation marks. ()"cel will !o this automatically if you use the point2an!2click metho!.3 For e"ample, here-s a formula that refers to a cell on a sheet name! All 'epts/ 0&,45&ll Depts53 &, +o$ &, closed 6o$.boo. t/e $efe$ence "s 0&,45C:\'y Documents\1-udget +o$ 7889.xls2!/eet,53
5ometimes, however, you may want to control when Excel calculates formulas . To select Aanual Calculation mode, clic3 the Aanual option button in the Tools 4options4calculation tab !hen you get the circular reference message after entering a formula, Excel gives you three optionsB Clic3 -; to attempt to locate the circular reference. Clic3 Cancel to enter the formula as is. Clic3 6elp for more information about circular references. )sually, you want to correct any circular references, so you should choose -;. To use the name for a value of formula ,E insert name F select cell with value or formula
A range intersection refers to cells that two ranges have in commonF 5yntax ex 0-,:-: &;:D;
Text formulas Sometimes, the importe! values are treate! as te"t. 4ere-s a 1uick way to convert these non2numbers to actual values. Activate any empty cell an! choose )!it$opy. #hen select the range that contains the values you nee! to fi". $hoose )!it%aste Special. ,n the %aste Special !ialog bo", select the A!! option an! then click *5. #his proce!ure essentially a!!s 6ero to each cell an!, in the process, forces )"cel to treat the non2numbers as actual values.
Even though a cell is formatted as Text (or uses an apostrophe , you can still perform some mathematical operations on the cell if the entry looks li3e a number code(A G.' code(a G9/ H concateneaIa
$ontrary to what you might e"pect, applying a number format to the cell that contains the formula has no effect. #his is because the formula returns a string, not a value.
-"./ removes all leading and trailing spaces and replaces internal strings of multiple spaces by a single space. C0123 removes all nonprinting characters from a string. These JgarbageK characters often appear when you import certain types of data.
4ate an ti#e
'epen!ing on your regional settings, entering a !ate in a format, such as 7une 89, :;;<, may be interprete! as a te"t string. ,n such a case, you woul! nee! to enter the !ate in a format that correspon!s to your regional settings, such as 89 7une, :;;<.
;eep in mind that a time value without a date uses Lanuary >, #9>> as the date !hen you enter a time that exceeds $& hours, the associated date for the time increments accordingly. For example, if you enter 25:55:55 into a cell, it is interpreted as #B>> AA on Lanuary #, #9>>. The day part of the entry increments because the time exceeds $& hours. ;eep in mind that a time value without a date uses Lanuary >, #9>> as the date. Creating %or#,las that co,nt an s,# Co,nti%6range7criteria8 intre ghili#ele aca criteria este o ct se p,ne oar c, 9irg,le7 aca se %ace o co#paratie se p,ne
#he $*&=#0LA=5 function !oes not count cells that contain a 6ero value, even if you uncheck the >ero values option in the *ptions !ialog bo" (select #ools *ptions, an! then click the ?iew tab3.
:ou can use the C-)7TM@A7; function with an argument that consists of entire rows or columns. For example, this next formula returns the number of blan3 cells in column AB
0COUNT-)&N<=&:&>
The following formula returns the number of empty cells on the entire wor3sheet named 5heet#. :ou must enter this formula on a sheet other than 5heet# or it will create a circular reference.
0COUNT-)&N<=!/eet,3,::??;:> $ounting numeric cells To count only the numeric cells in a range, use the following formula (which assumes the range is named Data B 0COUNT=D t > Cells that contain a date or a time are considered to be numeric cells. Cells that contain a logical value (T<)E or FA@5E are not considered to be numeric cells.
:ou can also use the C-)7T(F function in an array formula. The following array formula, for example, returns the same result as the previous formulaB
@0!U'=COUNTI+=D t A@,A;A?B>>B
Mut if you base your -r criteria on cells other than the cells being counted, the C-)7T(F function wonNt wor3 8erificate merg introdsue cu ctrl*shift *enter
:,##ing
0!U'=&,:&GAC,:CGAE,:EGAH,:HGAI,:IG> !umI+
The 5)A(F function is very useful for single,criterion sum formulas. The 5)A(F function ta3es three argumentsB range: The range containing the values that determine whether to include a particular cell in the sum. criteria: An expression that determines whether to include a particular cell in the sum. sum_range: -ptional. The range that contains the cells you want to sum. (f you omit this argument, the function uses the range specified in the first argument. -M5 5)A(f doesnNt wor3 with multiple criteria
0ook,p an relate
.$4**S) @eturns a specific value from a list of values (up to :93 supplie! as arguments. 4L**5&% 4ori6ontal lookup. Searches for a value in the top row of a table an! returns a value in the same column from a row you specify in the table. ,F @eturns one value if a con!ition you specify is #@&), an! returns another value if the con!ition is FALS). ,='). @eturns a value (or the reference to a value3 from within a table or range. L**5&% @eturns a value either from a one2row or one2column range. Another form of the L**5&% function works like ?L**5&% but is restricte! to returning a value from the last column of a range. +A#$4 @eturns the relative position of an item in a range that matches a specifie! value. *FFS)# @eturns a reference to a range that is a specifie! number of rows an! columns from a cell or range of cells. ?L**5&% ?ertical lookup. Searches for a value in the first column of a table an! returns a value in the same row from a column you specify in the table.
Mecause the last argument for the 8@--;)2 function is FA@5E, the function returns a value only if an exact match is found. (f the value is not found, the formula returns
INJ&
)OO<U*=loo.upKL lueAloo.upKLecto$A$esultKLecto$>
The @--;)2 function loo3s in a one,row or one,column range ( lookup_vector for a value (lookup_value and returns a value from the same position in a second onerow or one,column range (result_vector .
?alues in the lookup_vector must be in ascen!ing or!er. ,f lookup_value is smaller than the smallest value in lookup_vector, L**5&% returns INJ&. Looking in !ifferent tables
!hen the loo3up table is small (as in the example shown earlier in Figure #$,#> , you can use a literal array in place of the loo3up table
0M)OO<U*=-7A@8AC+CN98ACDCNO8ACCCNP8AC-CNG8AC&CBA7>
Another approach, which uses a more legible formula, is to use the @--;)2 function with two array argumentsB
0)OO<U*=-7A@8A98AO8AP8AG8BA@Q+CACDCACCCAC-CAC&CB>
The formula in cell M' wor3s similarly but uses the ProductList range.
0'&TCR=*$oductA*$oduct)"stA8> 0INDE(=T bleA-9A-?>
The final formula, in cell M., returns the corresponding sales amount. (t uses the (7"EO function with the results from cells M& and M'.
This formula wor3s by concatenating the contents of Make and Model and then searching for this text in an array consisting of the concatenated corresponding text in ange! and ange".
value of 1,>>>, which is the one closest to the #arget value of 1,>$' .
(f two values in the Data range are e+uidistant from the #arget value, the formula uses the first one in the list. The value in Col$%%set can be negative (for a column to the left of Data , positive (for a column to the right of Data , or > (for the actual closest match value in the Data range . To understand how this formula wor3s, you need to understand the (7"(<ECT function. This functionNs first argument is a text string in the form of a cell reference (or a reference to a cell that contains a text string . (n this example, the text string is created by the A""<E55 function, which accepts a row and column reference and returns a cell address.
Array formulas
To create a single array formula to perform the calculations, follow these stepsB 1* 5elect a range to hold the results. (n this case, the range is "$B"/. 2* Enter the following formulaB
0-7:-O4C7:CO
3* 7ormally, you press Enter to enter a formula. Mecause this is an array formula, however, press Ctrl*5hift*Enter. The formula is entered into all six of the selected cells. (f you examine the formula bar, you see the followingB
@0-7:-O4C7:COB
Excel places curly brac3ets around the formula to indicate that itNs an array formula. The following array formula is in cell C#>B
@0!U'=-7:-O4C7:CO>B
!hen you enter this formula, ma3e sure that you use Ctrl*5hift*Enter (and donNt type the curly brac3ets . This formula wor3s with two arrays, both of which are stored in cells. The first array is stored in M$BM/, and the second array is stored in C$BC/. The formula multiplies the corresponding values in these two arrays and creates a new array (which exists only in memory . The 5)A function then operates on this new array and returns the sum of its values. To create an array constant, list its items and surround them with brac3ets. 6ereNs an example of a five,item vertical array constantB
@,A8A,A8A,B
Ahen you specify an array !irectly (as shown previously3, you must provi!e the brackets aroun! the array elements. Ahen you enter an array formula, on the other han!, you !o not supply the brackets.
An array constant can contain numbers, text, logical values (T<)E or FA@5E , and even error values, such as Q74A. 7umbers can be in integer, decimal, or scientific format. :ou must enclose text in double +uotation mar3s (for example, JTuesdayK . :ou can use different types of values in the same array constant, as in this exampleB
@,A7A;ATRUEA+&)!EATRUEAC'oeCAC) $$yCACCu$lyCB
An array constant cannot contain formulas, functions, or other arrays. 7umeric values cannot contain dollar signs, commas, parentheses, or percent signs. For example, the following is an invalid array constantB ;ertical arra!
The elements in a one,dimensional vertical array are separated by semicolons. The following is a six,element vertical array constantB
@,8N78N;8N98N?8N:8B
Defining an array
7otice that, in the "efine 7ame dialog box, the array is defined (in the <efers To box using a leading e+ual sign (G . !ithout this e+ual sign, the array is interpreted as a text string rather than an array. Also, you must type the curly brac3ets when defining a named array constantF Excel does not enter them for you. :ou can easily identify an array formula, because the formula is enclosed in curly brac3ets in the formula bar. The following formula, for example, is an array formulaB
@0!U'=)EN=&,:&?>>B
"onNt enter the curly brac3ets when you create an array formulaF Excel inserts them for you. (f the result of an array formula consists of more than one value, you must select all of the cells in the results range be%ore you enter the formula. (f you fail to do this, only the first element of the result is returned. To edit an array formula, select all the cells in the array range and activate the formula bar as usual (clic3 it or press F$ . Excel removes the brac3ets from the formula while you edit it. Edit the formula and then press Ctrl*5hift*Enter to enter the changes. All of the cells in the array now reflect your editing changes.
@0ROT=,:,7>B
This formula generates a #$,element array that contains integers from # to #$. For a better solution, use this formulaB
@0ROT=INDIRECT=Q,:,7C>>B
This formula uses the (7"(<ECT function, which ta3es a text string as its argument. Excel does not adDust the references contained in the argument for the (7"(<ECT function. Therefore, this array formula al&a's returns integers from # to #$. The following formula returns the sum of the three smallest values in a range named DataB
@0!U'=!'&))=D t A@,A7A;B>>B
This formula eliminates the need for the (F function and ta3es advantage of the fact that and
+&)!E 4 , 0 8 @0&MER&HE=C7:C,?E-7:-,?>B
The (F function creates a new array that consists only of positive values and False values. This array is passed to the 5)A function, which ignores the False values and returns the sum of the positive values. The Data range can consist of any number of rows and columns. :ou can also use the Excel programNs 5)A(F function for this example. The following formula, which is not an array formula, returns the same result as the preceding array formulaB
0!U'I+=D t AC%8C>
For multiple conditions, however, using 5)A(F gets tric3y. For example, if you want to sum only values that are greater than > and less than or e+ual to ', you can use this non,array formulaB
!U'I+=d t AC%8CAd t >E!U'I+=d t AC%?CAd t >
This formula sums the values that are greater than Iero and then subtracts the sum of the values that are greater than '. This can be confusing. Following is an array formula that performs the same calculationB
@0!U'==D t %8>4=D t #0?>4D t >B
In n $$ y funct"on t/e ope$ to$s Q ndC JCo$C c nnot be used. Ex: @0!U'=I+=&ND=D t %8AD t #0?>AD t >>B @0!U'=I+=OR=D t #8AD t %?>AD t >>B T/"s c n be solLed us"ng @0!U'=I+==D t #8>F=D t %?>AD t >>B @0!U'==D t %8>4=D t #0?>4D t >B
This formula compares #heName to each cell in the NameList range. (t builds a new array that consists of logical T<)E or FA@5E values. The -< function returns T<)E if any one of the values in the new array is T<)E. The (F function uses this result to determine which message to display.
This formula wor3s only with a single embedded number. For example, it fails with a string li3e ,)*+--.
&
For certain chart types, you can add error bars to your chart. Error bars often are used to indicate Jplus or minusK information that reflects uncertainty in the data. Error bars are appropriate only for area, bar, column, line, and O: charts. Clic3 the : Error Mars tab in the Format "ata 5eries dialog box to display the error bars options.
A !ata series in an .Y chart can have error bars for both the . values an! Y values.
Excel enables you to specify several types of error barsB $i+e 9al,e: The error bars are fixed by an amount that you specify. Percentage: The error bars are a percentage of each value. :tan ar 4e9iation6s8: The error bars are in the number of standarddeviation units that you specify. (Excel calculates the standard deviation of the data series.
:tan ar 1rror: The error bars are one standard error unit. (Excel calculates the standard error of the data series. C,sto#: :ou set the error bar units for the upper or lower error bars. :ou can enter either a value or a range reference that holds the error values that you want to plot as error bars. Creating a combination chart simply involves changing one or more of the data series to a different chart type. 5elect the data series and then choose Chart Chart Type. (n the Chart Type dialog box, select the chart type that you want to apply to the selected series.
,n some cases, you can-t combine chart types. For e"ample, you can-t create a combination chart that involves a bubble chart or a B2' chart. ,f you choose an incompatible chart type for the series, )"cel lets you know.
The !ordArt applet enables you to create a graphic image from text. :ou can insert a !ordArt image by using the !ordArt tool on the "rawing toolbar or by selecting the (nsert2icture!ordArt command. Either method displays the !ordArt =allery dialog box. 5elect a style and then enter your text in the next dialog box. Clic3 -;, and the image is inserted in the wor3sheet. !hen you select a !ordArt image, Excel displays the !ordArt toolbar. )se these tools to modify the !ordArt image. :ouNll find that you have lots of flexibility with this tool. (n addition, you can use the 5hadow and %," tools (located on the "rawing toolbar to further manipulate the image. Figure #1,9 shows a few examples of !ordArt images inserted on a wor3sheet.
&uto +"lte$
Custom filter -wo iscrete 9al,es: For example, state e+ual to 7ew :or3 -< state e+ual to 7ew Lersey. 2ppro+i#ate #atches: :ou can use the C and R wildcards to filter in a number of other ways. The asteris3 matches any number of characters, and the +uestion mar3 matches any single character.
$ompute criteria
Sorting
!hat if you need to sort your list by more than three fieldsR (t can be done, but it ta3es an additional step. For example, assume that you want to sort your list by five fieldsB Field#, Field$, Field%, Field&, and Field'. 5tart by sorting by Field%, Field&, and Field'. Then re,sort the list by Field# and Field$. (n other words, sort the three
Jleast importantK fields firstF they remain in se+uence when you do the second sort
To insert subtotal formulas into a list automatically, move the cell pointer anywhere in the list and choose "ata5ubtotals. :ou see the dialog box shown in Figure #9,#.. (n this example, the list was sorted by Aonth. This dialog box offers the following choicesB 2t 1ach Change .n: This drop,down list displays all fields in your list. The field that you choose must be sorted. Use $,nction: This gives you a choice of ## functions. :ou should normally use 5um (the default . 2 :,)total -o: This list box lists all the fields in your list. 2lace a chec3 mar3 next to the field or fields that you want to subtotal. "eplace C,rrent :,)totals: (f this box is chec3ed, any existing subtotal formulas are removed and replaced with the new subtotals. Page (reak (etween >ro,ps: (f this box is chec3ed, Excel inserts a manual page brea3 after each subtotal. :,##ar! (elow 4ata: (f this box is chec3ed, the subtotals are placed below the data (the default . -therwise, the subtotal formulas are placed above the totals. "e#o9e 2ll: This button removes all subtotal formulas in the list.
#he S&0#*#AL function is very versatile. ,t-s uni1ue in that it is the only )"cel function that ignores cells in hi!!en rows. #here is one caveat, however/ #he rows must be hi!!en as a result of autofiltering or an outline. Simply hi!ing rows manually will have no effect on the results calculate! by the S&0#*#AL function. #he first argument for the S&0#*#AL function !etermines the actual function use!. For e"ample, when the first argument is 8, the S&0#*#AL function works like the A?)@Aa) function. #he following table shows the possible values for the first argument for the S&0#*#AL function/
Value Function 8 A?)@Aa)
: $*&=# B $*&=#A < +A. K +,= L %@*'&$# M S#')? 9 S#')?% 9 S&+ 8; ?A@ 88 ?A@%
Ahen the S&0#*#AL function is use! within a List (!esignate! by selecting 'ataList $reate List3, 8;; is a!!e! to the first argumentcfor e"ample, 8;9 instea! of 9. Ahen the first argument is greater than 8;;, the S&0#*#AL function behaves a bit !ifferently. Specifically, it !oes not inclu!e !ata in rows that were hi!!en manually. Ahen the first argument is less than 8;;, the S&0#*#AL function inclu!es !ata in rows that were hi!!en manually but e"clu!es !ata in rows that were hi!!en as a result of autofiltering. List @anges are !iscusse! later in this chapter.
Pi9ot ta)le
7ot all data can be used to create a pivot table. The data that you summariIe must be in the form of a database. :ou can store the database in either a wor3sheet (sometimes 3nown as a list or an external database file. Although Excel can generate a pivot table from any database, not all databases benefit. .olumn fiel 9 A fiel! that has a column orientation in the pivot table. )ach item in
the fiel! occupies a column. ,n the figure, $ustomer represents a column fiel! that contains two items ()"isting an! =ew3. You can have neste! column fiel!s. 4ata area9 #he cells in a pivot table that contain the summary !ata. )"cel offers several ways to summari6e the !ata (sum, average, count, an! so on3. ,n the figure, the 'ata area inclu!es $K/):;.
Gran totals9 A row or column that !isplays totals for all cells in a row or column in
a pivot table. You can specify that gran! totals be calculate! for rows, columns, or both (or neither3. #he pivot table in the figure shows gran! totals for both rows an! columns. Grou!9 A collection of items treate! as a single item. You can group items manually or automatically (group !ates into months, for e"ample3. #he pivot table in the figure !oes not have any !efine! groups. 5tem9 An element in a fiel! that appears as a row or column hea!er in a pivot table. ,n the figure, )"isting an! =ew are items for the $ustomer fiel!. #he 0ranch fiel! has three items/ $entral, =orth $ounty, an! Aestsi!e. Acct#ype has four items/ $', $hecking, ,@A (,nvestment @etirement Account3, an! Savings. Pa%e fiel 9 A fiel! that has a page orientation in the pivot tablecsimilar to a slice of a three2!imensional cube. You can !isplay only one item (or all items3 in a page fiel! at one time. ,n the figure, *pene!0y represents a page fiel! that !isplays the
=ew Accts item. 1efresh9 #o recalculate the pivot table after making changes to the source !ata. 1o( fiel 9 A fiel! that has a row orientation in the pivot table. )ach item in the fiel! occupies a row. You can have neste! row fiel!s. ,n the figure, 0ranch an! Acct#ype both represent row fiel!s. =ource ata9 #he !ata use! to create a pivot table. ,t can resi!e in a worksheet or an e"ternal !atabase. =u,totals9 A row or column that !isplays subtotals for !etail cells in a row or column in a pivot table. #he pivot table in the figure !isplays subtotals for each branch.
!hen you clic3 the @ayout button of the wiIardNs last dialog box, you get the dialog box shown in Figure $#,1. The fields in the database appear as buttons along the right side of the dialog box. 5imply drag the buttons to the appropriate area of the pivot table diagram (which appears in the center of the dialog box . The pivot table diagram has four areasB Page: Muttons in this area appear as page items in the pivot table. "ow: Muttons in this area appear as row items in the pivot table. 4ata: Muttons in this area indicate the data that is summariIed in the pivot table. Col,#n: Muttons in this area appear as column items in the pivot table.
4ere are its choices/ 8ame9 You can provi!e a name for the pivot table. )"cel provi!es !efault names in the form of %ivot#able8, %ivot#able:, an! so on. Gran Totals for .olumns9 $heck this bo" if you want )"cel to calculate gran! totals for items !isplaye! in columns. Gran Totals for 1o(s9 $heck this bo" if you want )"cel to calculate gran! totals for items !isplaye! in rows. &utoFormat Ta,le9 $heck this bo" if you want )"cel to apply one of its AutoFormats
to the pivot table. #he selecte! AutoFormat sticks with the pivot table, even ,f you rearrange the table layout. =u,total 2i en Pa%e 5tems9 $heck this bo" if you want )"cel to inclu!e hi!!en items in the page fiel!s in the subtotals. /er%e +a,els9 $heck this bo" if you want )"cel to merge the cells for outer row an! column labels. 'oing so may make the table more rea!able. Preser"e Formattin%9 $heck this bo" if you want )"cel, when it up!ates the pivot table, to keep any of the formatting that you applie!. 1e!eat 5tem +a,els on -ach Printe Pa%e9 $heck this bo" to set row titles that appear on each page when you print a pivot table report. /ark Totals (ith >9 Available only if you generate! the pivot table from an *LA% !ata source. ,f checke!, !isplays an asterisk after every subtotal an! gran! total to in!icate that these values inclu!e any hi!!en items as well as !isplaye! items. Pa%e +a*out9 You can specify the or!er in which you want the page fiel!s to appear. Fiel s !er .olumn9 You can specify the number of page fiel!s to show before starting another row of page fiel!s. For -rror ?alues, =ho(9 You can specify a value to show for pivot table cells that !isplay an error. For -m!t* .ells, =ho(9 You can specify a value to show for empty pivot table cells. =et Print Titles9 $heck this bo" to set column titles that appear at the top of each page when you print a %ivot#able report. =a"e 4ata (ith Ta,le +a*out9 ,f you check this option, )"cel stores an a!!itional copy of the !ata (calle! a pivot table cache3, which is store! with the workbook. ,f this option is not enable!, then )"cel must refresh the pivot table when the file is opene!. -na,le 4rill to 4etails9 ,f checke!, you can !ouble2click a cell in the !ata area of the pivot table to view the recor!s that contribute! to the summary value. 1efresh on '!en9 ,f checke!, the pivot table refreshes whenever you open the workbook. 1efresh -"er* x /inutes9 ,f you are connecte! to an e"ternal !atabase, you can specify how often you want the pivot table refreshe! while the workbook is open. =a"e Pass(or 9 ,f you use an e"ternal !atabase that re1uires a passwor!, you can store the passwor! as part of the 1uery so that you !on-t have to re2enter it. <ack%roun @uer*9 ,f checke!, )"cel runs the e"ternal !atabase 1uery in the backgroun! while you continue your work. '!timi0e /emor*9 #his option re!uces the amount of memory use! when you refresh an e"ternal !atabase 1uery.
Mecause a pivot table is a special type of data range, you canNt insert new rows or columns within the pivot table. This means that you canNt insert formulas to perform calculations with the data in a pivot table. 6owever, you can create calculated fields for a pivot table. A calculated %ield consists of a calculation that can involve other fields. A calculated field is basically a way to display new information in a pivot table. (t essentially presents an alternative to creating a new Data field in your source database. A calculated field cannot be used as a <ow, Column, or 2age field. )se the following procedure to create a calculated field that consists of the 5ales field divided by the )nits 5old fieldB 1* Aove the cell pointer anywhere within the pivot table. 2* )sing the 2ivotTable toolbar, choose 2ivotTable FormulasCalculated Field. Excel displays the (nsert Calculated Field dialog box. 3* Enter a descriptive name in the 7ame field and specify the formula in the Formula field (see Figure $#,#1 . The formula can use other fields and wor3sheet functions. For this example, the calculated field name is Avg )nit 2rice, and the formula appears as the followingB
0! lesJ5Un"ts !old5
4* Clic3 Add to add this new field. 5* Clic3 -; to close the (nsert Calculated Field dialog box. After you create the calculated field, Excel adds it to the "ata area of the pivot table. :ou can treat it Dust li3e any other field, with one exceptionB :ou canNt move it to the 2age, <ow, or Column area. ((t must remain in the "ata area.
4* Clic3 Add 5* <epeat 5teps % and & to create additional calculated items for Ttr,$ (GApr*Aay*Lun , Ttr,% (GLul*Aug*5ep , and Ttr,& (G-ct*7ov*"ec . 6* Clic3 -; to close the dialog box.
,f you use a calculate! item in your pivot table, you may nee! to turn off the aran! #otal !isplay to avoi! !ouble counting. ,n this e"ample the aran! #otal inclu!es the calculate! item, so each month is counte! twice. #o turn off aran! #otals, use the %ivot#able *ptions !ialog bo" (see the O%ivot #able *ptions si!ebar, earlier in this chapter3.
After you create the items, they appear in the pivot table. Figure $#,$# shows the
pivot table after youNve added the four calculated items. 7otice that the calculated items are added to the end of the Aonth items. :ou can rearrange the items by selecting and dragging. Figure $#,$$ shows the pivot table after rearranging the items logically. (( also made the calculated items bold.
A calculate! item appears in a pivot table only if the fiel! on which it is base! also appears. ,f you remove or pivot a fiel! from either the @ow or $olumn category into the 'ata category, the calculate! item !oes not appear.
(tNs also possible to get +uarterly summaries by grouping items. Mecause the month names are not actual dates, the grouping must be done manually. Figure $#,$% shows the pivot table after creating four groups. ( created the first group by selecting the Lan, Feb, and Aar items. ( then right,clic3ed and chose =roup and 5how "etail =roup from the shortcut menu. Excel inserted the default name, =roup #?which ( changed to Ttr #. 7ext, ( right,clic3ed the group item and chose Field 5ettings to display the 2ivotTable Field dialog box. (n this dialog box, ( specified the 5)A function to summariIe the grouped data. ( then repeated this process for the other three +uarters.